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 fr.ifremer.quadrige3.core.dao.system.ComputeFunction;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.Date;
34 import java.util.HashSet;
35
36
37
38
39
40 public abstract class Parameter
41 implements Serializable, Comparable<Parameter>
42 {
43
44
45
46 private static final long serialVersionUID = 8215576486796339348L;
47
48
49 private String parCd;
50
51
52
53
54
55 public String getParCd()
56 {
57 return this.parCd;
58 }
59
60
61
62
63
64 public void setParCd(String parCdIn)
65 {
66 this.parCd = parCdIn;
67 }
68
69 private String parNm;
70
71
72
73
74
75 public String getParNm()
76 {
77 return this.parNm;
78 }
79
80
81
82
83
84 public void setParNm(String parNmIn)
85 {
86 this.parNm = parNmIn;
87 }
88
89 private String parDc;
90
91
92
93
94
95 public String getParDc()
96 {
97 return this.parDc;
98 }
99
100
101
102
103
104 public void setParDc(String parDcIn)
105 {
106 this.parDc = parDcIn;
107 }
108
109 private String parIsQualitative;
110
111
112
113
114
115
116 public String getParIsQualitative()
117 {
118 return this.parIsQualitative;
119 }
120
121
122
123
124
125
126 public void setParIsQualitative(String parIsQualitativeIn)
127 {
128 this.parIsQualitative = parIsQualitativeIn;
129 }
130
131 private String parIsCalculated;
132
133
134
135
136
137 public String getParIsCalculated()
138 {
139 return this.parIsCalculated;
140 }
141
142
143
144
145
146 public void setParIsCalculated(String parIsCalculatedIn)
147 {
148 this.parIsCalculated = parIsCalculatedIn;
149 }
150
151 private String parIsTaxonomic;
152
153
154
155
156
157 public String getParIsTaxonomic()
158 {
159 return this.parIsTaxonomic;
160 }
161
162
163
164
165
166 public void setParIsTaxonomic(String parIsTaxonomicIn)
167 {
168 this.parIsTaxonomic = parIsTaxonomicIn;
169 }
170
171 private Date parCreationDt;
172
173
174
175
176
177 public Date getParCreationDt()
178 {
179 return this.parCreationDt;
180 }
181
182
183
184
185
186 public void setParCreationDt(Date parCreationDtIn)
187 {
188 this.parCreationDt = parCreationDtIn;
189 }
190
191 private Timestamp updateDt;
192
193
194
195
196
197 public Timestamp getUpdateDt()
198 {
199 return this.updateDt;
200 }
201
202
203
204
205
206 public void setUpdateDt(Timestamp updateDtIn)
207 {
208 this.updateDt = updateDtIn;
209 }
210
211 private String parCm;
212
213
214
215
216
217 public String getParCm()
218 {
219 return this.parCm;
220 }
221
222
223
224
225
226 public void setParCm(String parCmIn)
227 {
228 this.parCm = parCmIn;
229 }
230
231
232 private Collection<QualitativeValue> qualitativeValues = new HashSet<QualitativeValue>();
233
234
235
236
237
238 public Collection<QualitativeValue> getQualitativeValues()
239 {
240 return this.qualitativeValues;
241 }
242
243
244
245
246
247 public void setQualitativeValues(Collection<QualitativeValue> qualitativeValuesIn)
248 {
249 this.qualitativeValues = qualitativeValuesIn;
250 }
251
252
253
254
255
256
257
258 public boolean addQualitativeValues(QualitativeValue elementToAdd)
259 {
260 return this.qualitativeValues.add(elementToAdd);
261 }
262
263
264
265
266
267
268
269 public boolean removeQualitativeValues(QualitativeValue elementToRemove)
270 {
271 return this.qualitativeValues.remove(elementToRemove);
272 }
273
274 private Status status;
275
276
277
278
279
280 public Status getStatus()
281 {
282 return this.status;
283 }
284
285
286
287
288
289 public void setStatus(Status statusIn)
290 {
291 this.status = statusIn;
292 }
293
294 private ParameterGroup parGroupId;
295
296
297
298
299
300 public ParameterGroup getParGroupId()
301 {
302 return this.parGroupId;
303 }
304
305
306
307
308
309 public void setParGroupId(ParameterGroup parGroupIdIn)
310 {
311 this.parGroupId = parGroupIdIn;
312 }
313
314 private Collection<ComputeFunction> compFunctionCds = new HashSet<ComputeFunction>();
315
316
317
318
319
320 public Collection<ComputeFunction> getCompFunctionCds()
321 {
322 return this.compFunctionCds;
323 }
324
325
326
327
328
329 public void setCompFunctionCds(Collection<ComputeFunction> compFunctionCdsIn)
330 {
331 this.compFunctionCds = compFunctionCdsIn;
332 }
333
334
335
336
337
338
339
340 public boolean addCompFunctionCds(ComputeFunction elementToAdd)
341 {
342 return this.compFunctionCds.add(elementToAdd);
343 }
344
345
346
347
348
349
350
351 public boolean removeCompFunctionCds(ComputeFunction elementToRemove)
352 {
353 return this.compFunctionCds.remove(elementToRemove);
354 }
355
356 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
357
358
359
360
361
362 public Collection<Pmfm> getPmfms()
363 {
364 return this.pmfms;
365 }
366
367
368
369
370
371 public void setPmfms(Collection<Pmfm> pmfmsIn)
372 {
373 this.pmfms = pmfmsIn;
374 }
375
376
377
378
379
380
381
382 public boolean addPmfms(Pmfm elementToAdd)
383 {
384 return this.pmfms.add(elementToAdd);
385 }
386
387
388
389
390
391
392
393 public boolean removePmfms(Pmfm elementToRemove)
394 {
395 return this.pmfms.remove(elementToRemove);
396 }
397
398
399
400
401
402 @Override
403 public boolean equals(Object object)
404 {
405 if (this == object)
406 {
407 return true;
408 }
409 if (!(object instanceof Parameter))
410 {
411 return false;
412 }
413 final Parameter that = (Parameter)object;
414 if (this.parCd == null || that.getParCd() == null || !this.parCd.equals(that.getParCd()))
415 {
416 return false;
417 }
418 return true;
419 }
420
421
422
423
424 @Override
425 public int hashCode()
426 {
427 int hashCode = 0;
428 hashCode = 29 * hashCode + (this.parCd == null ? 0 : this.parCd.hashCode());
429
430 return hashCode;
431 }
432
433
434
435
436 public static final class Factory
437 {
438
439
440
441
442 public static Parameter newInstance()
443 {
444 return new ParameterImpl();
445 }
446
447
448
449
450
451
452
453
454 public static Parameter newInstance(Status status, ParameterGroup parGroupId)
455 {
456 final Parameter entity = new ParameterImpl();
457 entity.setStatus(status);
458 entity.setParGroupId(parGroupId);
459 return entity;
460 }
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480 public static Parameter newInstance(String parNm, String parDc, String parIsQualitative, String parIsCalculated, String parIsTaxonomic, Date parCreationDt, Timestamp updateDt, String parCm, Collection<QualitativeValue> qualitativeValues, Status status, ParameterGroup parGroupId, Collection<ComputeFunction> compFunctionCds, Collection<Pmfm> pmfms)
481 {
482 final Parameter entity = new ParameterImpl();
483 entity.setParNm(parNm);
484 entity.setParDc(parDc);
485 entity.setParIsQualitative(parIsQualitative);
486 entity.setParIsCalculated(parIsCalculated);
487 entity.setParIsTaxonomic(parIsTaxonomic);
488 entity.setParCreationDt(parCreationDt);
489 entity.setUpdateDt(updateDt);
490 entity.setParCm(parCm);
491 entity.setQualitativeValues(qualitativeValues);
492 entity.setStatus(status);
493 entity.setParGroupId(parGroupId);
494 entity.setCompFunctionCds(compFunctionCds);
495 entity.setPmfms(pmfms);
496 return entity;
497 }
498 }
499
500
501
502
503 public int compareTo(Parameter o)
504 {
505 int cmp = 0;
506 if (this.getParCd() != null)
507 {
508 cmp = this.getParCd().compareTo(o.getParCd());
509 }
510 else
511 {
512 if (this.getParNm() != null)
513 {
514 cmp = (cmp != 0 ? cmp : this.getParNm().compareTo(o.getParNm()));
515 }
516 if (this.getParDc() != null)
517 {
518 cmp = (cmp != 0 ? cmp : this.getParDc().compareTo(o.getParDc()));
519 }
520 if (this.getParIsQualitative() != null)
521 {
522 cmp = (cmp != 0 ? cmp : this.getParIsQualitative().compareTo(o.getParIsQualitative()));
523 }
524 if (this.getParIsCalculated() != null)
525 {
526 cmp = (cmp != 0 ? cmp : this.getParIsCalculated().compareTo(o.getParIsCalculated()));
527 }
528 if (this.getParIsTaxonomic() != null)
529 {
530 cmp = (cmp != 0 ? cmp : this.getParIsTaxonomic().compareTo(o.getParIsTaxonomic()));
531 }
532 if (this.getParCreationDt() != null)
533 {
534 cmp = (cmp != 0 ? cmp : this.getParCreationDt().compareTo(o.getParCreationDt()));
535 }
536 if (this.getUpdateDt() != null)
537 {
538 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
539 }
540 if (this.getParCm() != null)
541 {
542 cmp = (cmp != 0 ? cmp : this.getParCm().compareTo(o.getParCm()));
543 }
544 }
545 return cmp;
546 }
547
548
549 }