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