1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.referential.pmfm;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import fr.ifremer.quadrige3.core.dao.referential.Status;
29 import java.io.Serializable;
30 import java.sql.Timestamp;
31 import java.util.Collection;
32 import java.util.HashSet;
33
34
35
36
37
38 public abstract class ParameterGroup
39 implements Serializable, Comparable<ParameterGroup>
40 {
41
42
43
44 private static final long serialVersionUID = -1519673634674026670L;
45
46
47 private Integer parGroupId;
48
49
50
51
52
53 public Integer getParGroupId()
54 {
55 return this.parGroupId;
56 }
57
58
59
60
61
62 public void setParGroupId(Integer parGroupIdIn)
63 {
64 this.parGroupId = parGroupIdIn;
65 }
66
67 private String parGroupNm;
68
69
70
71
72
73 public String getParGroupNm()
74 {
75 return this.parGroupNm;
76 }
77
78
79
80
81
82 public void setParGroupNm(String parGroupNmIn)
83 {
84 this.parGroupNm = parGroupNmIn;
85 }
86
87 private String parGroupDc;
88
89
90
91
92
93 public String getParGroupDc()
94 {
95 return this.parGroupDc;
96 }
97
98
99
100
101
102 public void setParGroupDc(String parGroupDcIn)
103 {
104 this.parGroupDc = parGroupDcIn;
105 }
106
107 private Timestamp updateDt;
108
109
110
111
112
113 public Timestamp getUpdateDt()
114 {
115 return this.updateDt;
116 }
117
118
119
120
121
122 public void setUpdateDt(Timestamp updateDtIn)
123 {
124 this.updateDt = updateDtIn;
125 }
126
127
128 private Status status;
129
130
131
132
133
134 public Status getStatus()
135 {
136 return this.status;
137 }
138
139
140
141
142
143 public void setStatus(Status statusIn)
144 {
145 this.status = statusIn;
146 }
147
148 private Collection<Parameter> parCds = new HashSet<Parameter>();
149
150
151
152
153
154 public Collection<Parameter> getParCds()
155 {
156 return this.parCds;
157 }
158
159
160
161
162
163 public void setParCds(Collection<Parameter> parCdsIn)
164 {
165 this.parCds = parCdsIn;
166 }
167
168
169
170
171
172
173
174 public boolean addParCds(Parameter elementToAdd)
175 {
176 return this.parCds.add(elementToAdd);
177 }
178
179
180
181
182
183
184
185 public boolean removeParCds(Parameter elementToRemove)
186 {
187 return this.parCds.remove(elementToRemove);
188 }
189
190 private Collection<ParameterGroup> parameterGroups = new HashSet<ParameterGroup>();
191
192
193
194
195
196 public Collection<ParameterGroup> getParameterGroups()
197 {
198 return this.parameterGroups;
199 }
200
201
202
203
204
205 public void setParameterGroups(Collection<ParameterGroup> parameterGroupsIn)
206 {
207 this.parameterGroups = parameterGroupsIn;
208 }
209
210
211
212
213
214
215
216 public boolean addParameterGroups(ParameterGroup elementToAdd)
217 {
218 return this.parameterGroups.add(elementToAdd);
219 }
220
221
222
223
224
225
226
227 public boolean removeParameterGroups(ParameterGroup elementToRemove)
228 {
229 return this.parameterGroups.remove(elementToRemove);
230 }
231
232 private ParameterGroup parentParGroupId;
233
234
235
236
237
238 public ParameterGroup getParentParGroupId()
239 {
240 return this.parentParGroupId;
241 }
242
243
244
245
246
247 public void setParentParGroupId(ParameterGroup parentParGroupIdIn)
248 {
249 this.parentParGroupId = parentParGroupIdIn;
250 }
251
252
253
254
255
256 @Override
257 public boolean equals(Object object)
258 {
259 if (this == object)
260 {
261 return true;
262 }
263 if (!(object instanceof ParameterGroup))
264 {
265 return false;
266 }
267 final ParameterGroup that = (ParameterGroup)object;
268 if (this.parGroupId == null || that.getParGroupId() == null || !this.parGroupId.equals(that.getParGroupId()))
269 {
270 return false;
271 }
272 return true;
273 }
274
275
276
277
278 @Override
279 public int hashCode()
280 {
281 int hashCode = 0;
282 hashCode = 29 * hashCode + (this.parGroupId == null ? 0 : this.parGroupId.hashCode());
283
284 return hashCode;
285 }
286
287
288
289
290 public static final class Factory
291 {
292
293
294
295
296 public static ParameterGroup newInstance()
297 {
298 return new ParameterGroupImpl();
299 }
300
301
302
303
304
305
306
307
308 public static ParameterGroup newInstance(String parGroupNm, Status status)
309 {
310 final ParameterGroup entity = new ParameterGroupImpl();
311 entity.setParGroupNm(parGroupNm);
312 entity.setStatus(status);
313 return entity;
314 }
315
316
317
318
319
320
321
322
323
324
325
326
327
328 public static ParameterGroup newInstance(String parGroupNm, String parGroupDc, Timestamp updateDt, Status status, Collection<Parameter> parCds, Collection<ParameterGroup> parameterGroups, ParameterGroup parentParGroupId)
329 {
330 final ParameterGroup entity = new ParameterGroupImpl();
331 entity.setParGroupNm(parGroupNm);
332 entity.setParGroupDc(parGroupDc);
333 entity.setUpdateDt(updateDt);
334 entity.setStatus(status);
335 entity.setParCds(parCds);
336 entity.setParameterGroups(parameterGroups);
337 entity.setParentParGroupId(parentParGroupId);
338 return entity;
339 }
340 }
341
342
343
344
345 public int compareTo(ParameterGroup o)
346 {
347 int cmp = 0;
348 if (this.getParGroupId() != null)
349 {
350 cmp = this.getParGroupId().compareTo(o.getParGroupId());
351 }
352 else
353 {
354 if (this.getParGroupNm() != null)
355 {
356 cmp = (cmp != 0 ? cmp : this.getParGroupNm().compareTo(o.getParGroupNm()));
357 }
358 if (this.getParGroupDc() != null)
359 {
360 cmp = (cmp != 0 ? cmp : this.getParGroupDc().compareTo(o.getParGroupDc()));
361 }
362 if (this.getUpdateDt() != null)
363 {
364 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
365 }
366 }
367 return cmp;
368 }
369
370
371 }