1 | public class User {↵ | | 1 | public class Parent {
↵
|
2 | private String name;↵ | | 2 | private String name;
↵
|
3 | private List groups = new ArrayList();↵ | | 3 | private ↵
|
4 | ↵ | | |
|
5 | User() {}↵ | | |
|
6 | ↵ | | 4 | Set children = new HashSet();↵
|
|
| | | 5 | public Parent() {↵
|
| | | 6 | }↵
|
| | | 7 |
↵
|
7 | public User(String name) {↵ | | 8 | public Parent(String name) {
↵
|
8 | this.name = name;↵ | | 9 | this.name = name;
↵
|
9 | }↵ | | 10 | }↵
|
|
| | | 11 |
↵
|
10 | public String getName() {↵ | | 12 | public String getName() {
↵
|
11 | return name;↵ | | 13 | return name;
↵
|
12 | }↵ | | 14 | }↵
|
13 | ↵ | | |
|
|
14 | ↵ | | |
|
|
15 | void setName(String name) {↵ | | 15 | public void setName(String name) {
↵
|
16 | this.name = name;↵ | | 16 | this.name = name;
↵
|
17 | }↵ | | 17 | }↵
|
|
| | | 18 |
↵
|
18 | public List getGroups() {↵ | | 19 | public Set getChildren() {
↵
|
19 | return groups;↵ | | 20 | return ↵
|
20 | }↵ | | |
|
21 | ↵ | | |
|
22 | void setGroups(List groups↵ | | 21 | children;↵
|
| | | 22 | }↵
|
|
23 | ) {↵ | | 23 | public void setChildren(Set children) {
↵
|
24 | this.groups = groups;↵ | | 24 | this.children = children;
↵
|
25 | | | 25 |
|