This commit is contained in:
hesham 2019-02-27 04:46:21 +03:00
parent 8a37f15a13
commit dc698c3f88
2 changed files with 96 additions and 96 deletions

70
pom.xml
View File

@ -1,33 +1,39 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Java</groupId>
<artifactId>Java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JavaTesting</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
</dependencies>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Java</groupId>
<artifactId>Java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JavaTesting</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,64 +1,58 @@
public class Person {
private Account account;
private Education edu;
private String name;
private Car car;
private Location location;
public Person(int ID, String name, Level lvl) {
account = new Account(name,ID);
edu = new Education(null, null, lvl);
car = new Car();
location = new Location();
this.name = name;
}
public Account getAccount() {
return account;
}
public Education getEdu() {
return edu;
}
public Car getCar() {
return car;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public void setCar(Car car) {
this.car = car;
}
public boolean hasCar() {
if (car.getMake() != null) {
return true;
}
else return false;
}
public boolean isPHD() {
if (this.edu.getLevel() == Level.PHD) {
return true;
}
else return false;
}
}
public class Person {
private Account account;
private Education edu;
private String name;
private Car car;
private Location location;
public Person(int ID, String name, Level lvl) {
account = new Account(name, ID);
edu = new Education(null, null, lvl);
car = new Car();
location = new Location();
this.name = name;
}
public Account getAccount() {
return account;
}
public Education getEdu() {
return edu;
}
public Car getCar() {
return car;
}
public void setCar(Car car) {
this.car = car;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public boolean hasCar() {
return car.getMake() != null;
}
public boolean isPHD() {
return this.edu.getLevel() == Level.PHD;
}
}