1 | public class Person {↵ | | 1 | public class Task {↵
|
2 | private String name;↵ | | 2 | private String ↵
|
3 | private Date dob↵ | | 3 | description;↵
|
4 | ;↵ | | 4 | private Person person;↵
|
5 | private String currentAddress;↵ | | 5 | private ↵
|
6 | P↵ | | 6 | int version;↵
|
| | | 7 | ↵
|
7 | erson() {↵ | | 8 | public int getVersion() {↵
|
| | | 9 | return version;↵
|
8 | }↵ | | 10 | }↵
|
9 | public Person(String name, Date dob, String address) {↵ | | 11 | public void setVersion(↵
|
10 | this.name = name;↵ | | |
|
11 | this.dob = dob;↵ | | |
|
12 | this.currentAddress = address;↵ | | |
|
13 | }↵ | | |
|
14 | public Date getDob() {↵ | | |
|
15 | return dob;↵ | | |
|
16 | }↵ | | |
|
17 | public void setDob(Date dob) {↵ | | |
|
18 | this.dob = dob↵ | | 12 | int version) {↵
|
| | | 13 | this.version = version;↵
|
| | | 14 | }↵
|
| | | 15 | Task() {}↵
|
| | | 16 | public Task(String description, Person person) {↵
|
| | | 17 | this.description = description;↵
|
| | | 18 | this.person = person;↵
|
19 | ;↵ | | 19 | person.getTasks().add(this);↵
|
20 | }↵ | | 20 | }↵
|
21 | public String getName() {↵ | | 21 | public String getDescription() {↵
|
22 | return name;↵ | | 22 | return description;↵
|
23 | }↵ | | 23 | }↵
|
24 | public void setName(String name) {↵ | | 24 | public void set↵
|
25 | this.name = name;↵ | | |
|
26 | }↵ | | |
|
27 | public String getCurrentAddress() {↵ | | |
|
28 | return currentAddress;↵ | | |
|
29 | }↵ | | |
|
30 | public void setCurrentAddress(String currentAddress) {↵ | | |
|
31 | this.currentAddress = currentAddress | | 25 | Description(String description) {↵
|
| | | 26 | this.description = description;↵
|
| | | 27 | }↵
|
| | | 28 | public Person getPerson() {↵
|
| | | 29 | return person;↵
|
| | | 30 | }↵
|
| | | 31 | public void setPerson(Person person) {↵
|
| | | 32 | this.person = person
|