1 | public class Person {↵ | | 1 | public class Employee extends Person {↵
|
2 | ↵ | | |
|
3 | private Long id;
↵ | | 2 | private String title;↵
|
4 | private String name;↵ | | 3 | private String ↵
|
5 | private Address address;↵ | | |
|
6 | private PersonalDetails details;↵ | | |
|
7 |
↵ | | 4 | department;↵
|
| | | 5 | private Employee manager;↵
|
| | | 6 | private Set minions = new HashSet();↵
|
|
8 | public Person() {
↵ | | 7 | public Employee() {↵
|
9 | }↵ | | 8 | }↵
|
10 |
↵ | | |
|
|
11 | public Person(String name) {
↵ | | 9 | public Employee(String name) {↵
|
12 | this.name = name;↵ | | 10 | super( name↵
|
13 | }↵ | | |
|
14 |
↵ | | 11 | );↵
|
| | | 12 | }↵
|
|
15 | public Long getId() {
↵ | | 13 | public String getTitle() {↵
|
16 | return id;↵ | | 14 | return ↵
|
17 | }↵ | | |
|
18 |
↵ | | 15 | title;↵
|
| | | 16 | }↵
|
|
19 | public void setId(Long id) {
↵ | | 17 | public void setTitle(String title) {↵
|
20 | this.id = id;↵ | | 18 | this.↵
|
21 | }↵ | | |
|
22 |
↵ | | 19 | title = title;↵
|
| | | 20 | }↵
|
|
23 | public String getName() {
↵ | | 21 | public String getDepartment() {↵
|
24 | return name;↵ | | 22 | return ↵
|
25 | }↵ | | |
|
26 |
↵ | | 23 | department;↵
|
| | | 24 | }↵
|
|
27 | public void setName(String name) {
↵ | | 25 | public void setDepartment(String department) {↵
|
28 | this.name = name;↵ | | 26 | this.↵
|
29 | }↵ | | |
|
|
30 | public Address getAddress↵ | | 27 | department = department;↵
|
| | | 28 | }↵
|
|
31 | () {
↵ | | 29 | public Employee getManager() {↵
|
32 | return address;↵ | | 30 | return ↵
|
33 | }↵ | | |
|
34 |
↵ | | 31 | manager;↵
|
| | | 32 | }↵
|
|
35 | public void setAddress(Address address) {
↵ | | 33 | public void setManager(Employee manager) {↵
|
36 | this.address = address;↵ | | 34 | this.↵
|
37 | }↵ | | |
|
|
38 | public PersonalDetails getDetail↵ | | 35 | manager = manager;↵
|
| | | 36 | }↵
|
|
39 | s() {
↵ | | 37 | public Set getMinions() {↵
|
40 | return details;
↵ | | 38 | return minions;↵
|
41 | }↵ | | 39 | }↵
|
42 |
↵ | | |
|
|
43 | public void setDetails(PersonalDetails details) {
↵ | | 40 | public void setMinions(Set minions) {↵
|
44 | this.details = details;
↵ | | 41 | this.minions = minions;↵
|
45 | | | 42 |
|