1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.to;
20
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.ws.rs.PathParam;
24 import org.apache.commons.lang3.builder.EqualsBuilder;
25 import org.apache.commons.lang3.builder.HashCodeBuilder;
26 import org.apache.syncope.common.lib.attr.AttrRepoConf;
27 import org.apache.syncope.common.lib.types.AttrRepoState;
28
29 public class AttrRepoTO implements EntityTO {
30
31 private static final long serialVersionUID = -7490425997956703057L;
32
33 private String key;
34
35 private String description;
36
37 private AttrRepoState state = AttrRepoState.ACTIVE;
38
39 private int order = 0;
40
41 private final List<Item> items = new ArrayList<>();
42
43 private AttrRepoConf conf;
44
45 @Override
46 public String getKey() {
47 return key;
48 }
49
50 @PathParam("key")
51 @Override
52 public void setKey(final String key) {
53 this.key = key;
54 }
55
56 public String getDescription() {
57 return description;
58 }
59
60 public void setDescription(final String description) {
61 this.description = description;
62 }
63
64 public AttrRepoState getState() {
65 return state;
66 }
67
68 public void setState(final AttrRepoState state) {
69 this.state = state;
70 }
71
72 public int getOrder() {
73 return order;
74 }
75
76 public void setOrder(final int order) {
77 this.order = order;
78 }
79
80 public List<Item> getItems() {
81 return items;
82 }
83
84 public AttrRepoConf getConf() {
85 return conf;
86 }
87
88 public void setConf(final AttrRepoConf conf) {
89 this.conf = conf;
90 }
91
92 @Override
93 public boolean equals(final Object obj) {
94 if (this == obj) {
95 return true;
96 }
97 if (obj == null) {
98 return false;
99 }
100 if (getClass() != obj.getClass()) {
101 return false;
102 }
103 AttrRepoTO other = (AttrRepoTO) obj;
104 return new EqualsBuilder().
105 append(key, other.key).
106 append(description, other.description).
107 append(state, other.state).
108 append(order, other.order).
109 append(items, other.items).
110 append(conf, other.conf).
111 build();
112 }
113
114 @Override
115 public int hashCode() {
116 return new HashCodeBuilder().
117 append(key).
118 append(description).
119 append(state).
120 append(order).
121 append(items).
122 append(conf).
123 build();
124 }
125 }