1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.referential;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import java.io.Serializable;
29 import java.sql.Timestamp;
30 import java.util.Collection;
31 import java.util.HashSet;
32
33
34
35
36
37 public abstract class Status
38 implements Serializable, Comparable<Status>
39 {
40
41
42
43 private static final long serialVersionUID = 2413971720867301580L;
44
45
46 private String statusCd;
47
48
49
50
51
52 public String getStatusCd()
53 {
54 return this.statusCd;
55 }
56
57
58
59
60
61 public void setStatusCd(String statusCdIn)
62 {
63 this.statusCd = statusCdIn;
64 }
65
66 private String statusNm;
67
68
69
70
71
72 public String getStatusNm()
73 {
74 return this.statusNm;
75 }
76
77
78
79
80
81 public void setStatusNm(String statusNmIn)
82 {
83 this.statusNm = statusNmIn;
84 }
85
86 private String statusDc;
87
88
89
90
91
92 public String getStatusDc()
93 {
94 return this.statusDc;
95 }
96
97
98
99
100
101 public void setStatusDc(String statusDcIn)
102 {
103 this.statusDc = statusDcIn;
104 }
105
106 private Timestamp updateDt;
107
108
109
110
111
112 public Timestamp getUpdateDt()
113 {
114 return this.updateDt;
115 }
116
117
118
119
120
121 public void setUpdateDt(Timestamp updateDtIn)
122 {
123 this.updateDt = updateDtIn;
124 }
125
126
127 private Collection<PrecisionType> precisionTypes = new HashSet<PrecisionType>();
128
129
130
131
132
133 public Collection<PrecisionType> getPrecisionTypes()
134 {
135 return this.precisionTypes;
136 }
137
138
139
140
141
142 public void setPrecisionTypes(Collection<PrecisionType> precisionTypesIn)
143 {
144 this.precisionTypes = precisionTypesIn;
145 }
146
147
148
149
150
151
152
153 public boolean addPrecisionTypes(PrecisionType elementToAdd)
154 {
155 return this.precisionTypes.add(elementToAdd);
156 }
157
158
159
160
161
162
163
164 public boolean removePrecisionTypes(PrecisionType elementToRemove)
165 {
166 return this.precisionTypes.remove(elementToRemove);
167 }
168
169
170
171
172
173 @Override
174 public boolean equals(Object object)
175 {
176 if (this == object)
177 {
178 return true;
179 }
180 if (!(object instanceof Status))
181 {
182 return false;
183 }
184 final Status that = (Status)object;
185 if (this.statusCd == null || that.getStatusCd() == null || !this.statusCd.equals(that.getStatusCd()))
186 {
187 return false;
188 }
189 return true;
190 }
191
192
193
194
195 @Override
196 public int hashCode()
197 {
198 int hashCode = 0;
199 hashCode = 29 * hashCode + (this.statusCd == null ? 0 : this.statusCd.hashCode());
200
201 return hashCode;
202 }
203
204
205
206
207 public static final class Factory
208 {
209
210
211
212
213 public static Status newInstance()
214 {
215 return new StatusImpl();
216 }
217
218
219
220
221
222
223
224 public static Status newInstance(String statusNm)
225 {
226 final Status entity = new StatusImpl();
227 entity.setStatusNm(statusNm);
228 return entity;
229 }
230
231
232
233
234
235
236
237
238
239
240 public static Status newInstance(String statusNm, String statusDc, Timestamp updateDt, Collection<PrecisionType> precisionTypes)
241 {
242 final Status entity = new StatusImpl();
243 entity.setStatusNm(statusNm);
244 entity.setStatusDc(statusDc);
245 entity.setUpdateDt(updateDt);
246 entity.setPrecisionTypes(precisionTypes);
247 return entity;
248 }
249 }
250
251
252
253
254 public int compareTo(Status o)
255 {
256 int cmp = 0;
257 if (this.getStatusCd() != null)
258 {
259 cmp = this.getStatusCd().compareTo(o.getStatusCd());
260 }
261 else
262 {
263 if (this.getStatusNm() != null)
264 {
265 cmp = (cmp != 0 ? cmp : this.getStatusNm().compareTo(o.getStatusNm()));
266 }
267 if (this.getStatusDc() != null)
268 {
269 cmp = (cmp != 0 ? cmp : this.getStatusDc().compareTo(o.getStatusDc()));
270 }
271 if (this.getUpdateDt() != null)
272 {
273 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
274 }
275 }
276 return cmp;
277 }
278
279
280 }