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