-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerson.java
81 lines (66 loc) · 1.98 KB
/
Person.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* An abstract class that defines a person to be inherited
*/
import java.util.UUID;
import java.util.Date;
public abstract class Person {
protected UUID uuid;
protected String firstName;
protected String lastName;
protected Date dateOfBirth;
protected String homeAddress;
/**
* A method to create an instance of a person
*
* @param firstName A string for their first name
* @param lastName A string for their last name
* @param dateOfBirth2 A string for their date of birth
* @param homeAddress A string for their home address
*/
// Constructor without UUID
public Person(String firstName, String lastName, Date dateOfBirth, String homeAddress) {
this.uuid = UUID.randomUUID();
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = dateOfBirth;
this.homeAddress = homeAddress;
}
// constructor with UUID
public Person(UUID uuid, String firstName, String lastName, Date dateOfBirth, String homeAddress) {
this.uuid = uuid;
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = dateOfBirth;
this.homeAddress = homeAddress;
}
public UUID getUUID() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
public Date getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(String homeAddress) {
this.homeAddress = homeAddress;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}