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.referential.Unit;
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 Pmfm
41 implements Serializable, Comparable<Pmfm>
42 {
43
44
45
46 private static final long serialVersionUID = 7341255652236886596L;
47
48
49 private Float pmfmDetectionThreshold;
50
51
52
53
54
55 public Float getPmfmDetectionThreshold()
56 {
57 return this.pmfmDetectionThreshold;
58 }
59
60
61
62
63
64 public void setPmfmDetectionThreshold(Float pmfmDetectionThresholdIn)
65 {
66 this.pmfmDetectionThreshold = pmfmDetectionThresholdIn;
67 }
68
69 private Short pmfmMaximumNumberDecimals;
70
71
72
73
74
75
76 public Short getPmfmMaximumNumberDecimals()
77 {
78 return this.pmfmMaximumNumberDecimals;
79 }
80
81
82
83
84
85
86 public void setPmfmMaximumNumberDecimals(Short pmfmMaximumNumberDecimalsIn)
87 {
88 this.pmfmMaximumNumberDecimals = pmfmMaximumNumberDecimalsIn;
89 }
90
91 private Short pmfmSignifFiguresNumber;
92
93
94
95
96
97 public Short getPmfmSignifFiguresNumber()
98 {
99 return this.pmfmSignifFiguresNumber;
100 }
101
102
103
104
105
106 public void setPmfmSignifFiguresNumber(Short pmfmSignifFiguresNumberIn)
107 {
108 this.pmfmSignifFiguresNumber = pmfmSignifFiguresNumberIn;
109 }
110
111 private Timestamp updateDt;
112
113
114
115
116
117 public Timestamp getUpdateDt()
118 {
119 return this.updateDt;
120 }
121
122
123
124
125
126 public void setUpdateDt(Timestamp updateDtIn)
127 {
128 this.updateDt = updateDtIn;
129 }
130
131 private Integer pmfmId;
132
133
134
135
136
137 public Integer getPmfmId()
138 {
139 return this.pmfmId;
140 }
141
142
143
144
145
146 public void setPmfmId(Integer pmfmIdIn)
147 {
148 this.pmfmId = pmfmIdIn;
149 }
150
151 private String pmfmCm;
152
153
154
155
156
157 public String getPmfmCm()
158 {
159 return this.pmfmCm;
160 }
161
162
163
164
165
166 public void setPmfmCm(String pmfmCmIn)
167 {
168 this.pmfmCm = pmfmCmIn;
169 }
170
171 private Date creationDt;
172
173
174
175
176
177 public Date getCreationDt()
178 {
179 return this.creationDt;
180 }
181
182
183
184
185
186 public void setCreationDt(Date creationDtIn)
187 {
188 this.creationDt = creationDtIn;
189 }
190
191
192 private Unit unit;
193
194
195
196
197
198 public Unit getUnit()
199 {
200 return this.unit;
201 }
202
203
204
205
206
207 public void setUnit(Unit unitIn)
208 {
209 this.unit = unitIn;
210 }
211
212 private Matrix matrix;
213
214
215
216
217
218 public Matrix getMatrix()
219 {
220 return this.matrix;
221 }
222
223
224
225
226
227 public void setMatrix(Matrix matrixIn)
228 {
229 this.matrix = matrixIn;
230 }
231
232 private Fraction fraction;
233
234
235
236
237
238 public Fraction getFraction()
239 {
240 return this.fraction;
241 }
242
243
244
245
246
247 public void setFraction(Fraction fractionIn)
248 {
249 this.fraction = fractionIn;
250 }
251
252 private Parameter parameter;
253
254
255
256
257
258 public Parameter getParameter()
259 {
260 return this.parameter;
261 }
262
263
264
265
266
267 public void setParameter(Parameter parameterIn)
268 {
269 this.parameter = parameterIn;
270 }
271
272 private Method method;
273
274
275
276
277
278 public Method getMethod()
279 {
280 return this.method;
281 }
282
283
284
285
286
287 public void setMethod(Method methodIn)
288 {
289 this.method = methodIn;
290 }
291
292 private Status status;
293
294
295
296
297
298 public Status getStatus()
299 {
300 return this.status;
301 }
302
303
304
305
306
307 public void setStatus(Status statusIn)
308 {
309 this.status = statusIn;
310 }
311
312 private Collection<PmfmQualValue> pmfmQualValues = new HashSet<PmfmQualValue>();
313
314
315
316
317
318
319 public Collection<PmfmQualValue> getPmfmQualValues()
320 {
321 return this.pmfmQualValues;
322 }
323
324
325
326
327
328
329 public void setPmfmQualValues(Collection<PmfmQualValue> pmfmQualValuesIn)
330 {
331 this.pmfmQualValues = pmfmQualValuesIn;
332 }
333
334
335
336
337
338
339
340
341 public boolean addPmfmQualValues(PmfmQualValue elementToAdd)
342 {
343 return this.pmfmQualValues.add(elementToAdd);
344 }
345
346
347
348
349
350
351
352
353 public boolean removePmfmQualValues(PmfmQualValue elementToRemove)
354 {
355 return this.pmfmQualValues.remove(elementToRemove);
356 }
357
358
359
360
361
362 @Override
363 public boolean equals(Object object)
364 {
365 if (this == object)
366 {
367 return true;
368 }
369 if (!(object instanceof Pmfm))
370 {
371 return false;
372 }
373 final Pmfm that = (Pmfm)object;
374 if (this.pmfmId == null || that.getPmfmId() == null || !this.pmfmId.equals(that.getPmfmId()))
375 {
376 return false;
377 }
378 return true;
379 }
380
381
382
383
384 @Override
385 public int hashCode()
386 {
387 int hashCode = 0;
388 hashCode = 29 * hashCode + (this.pmfmId == null ? 0 : this.pmfmId.hashCode());
389
390 return hashCode;
391 }
392
393
394
395
396 public static final class Factory
397 {
398
399
400
401
402 public static Pmfm newInstance()
403 {
404 return new PmfmImpl();
405 }
406
407
408
409
410
411
412
413
414
415
416
417
418 public static Pmfm newInstance(Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status)
419 {
420 final Pmfm entity = new PmfmImpl();
421 entity.setUnit(unit);
422 entity.setMatrix(matrix);
423 entity.setFraction(fraction);
424 entity.setParameter(parameter);
425 entity.setMethod(method);
426 entity.setStatus(status);
427 return entity;
428 }
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448 public static Pmfm newInstance(Float pmfmDetectionThreshold, Short pmfmMaximumNumberDecimals, Short pmfmSignifFiguresNumber, Timestamp updateDt, String pmfmCm, Date creationDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status, Collection<PmfmQualValue> pmfmQualValues)
449 {
450 final Pmfm entity = new PmfmImpl();
451 entity.setPmfmDetectionThreshold(pmfmDetectionThreshold);
452 entity.setPmfmMaximumNumberDecimals(pmfmMaximumNumberDecimals);
453 entity.setPmfmSignifFiguresNumber(pmfmSignifFiguresNumber);
454 entity.setUpdateDt(updateDt);
455 entity.setPmfmCm(pmfmCm);
456 entity.setCreationDt(creationDt);
457 entity.setUnit(unit);
458 entity.setMatrix(matrix);
459 entity.setFraction(fraction);
460 entity.setParameter(parameter);
461 entity.setMethod(method);
462 entity.setStatus(status);
463 entity.setPmfmQualValues(pmfmQualValues);
464 return entity;
465 }
466 }
467
468
469
470
471 public int compareTo(Pmfm o)
472 {
473 int cmp = 0;
474 if (this.getPmfmId() != null)
475 {
476 cmp = this.getPmfmId().compareTo(o.getPmfmId());
477 }
478 else
479 {
480 if (this.getPmfmDetectionThreshold() != null)
481 {
482 cmp = (cmp != 0 ? cmp : this.getPmfmDetectionThreshold().compareTo(o.getPmfmDetectionThreshold()));
483 }
484 if (this.getPmfmMaximumNumberDecimals() != null)
485 {
486 cmp = (cmp != 0 ? cmp : this.getPmfmMaximumNumberDecimals().compareTo(o.getPmfmMaximumNumberDecimals()));
487 }
488 if (this.getPmfmSignifFiguresNumber() != null)
489 {
490 cmp = (cmp != 0 ? cmp : this.getPmfmSignifFiguresNumber().compareTo(o.getPmfmSignifFiguresNumber()));
491 }
492 if (this.getUpdateDt() != null)
493 {
494 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
495 }
496 if (this.getPmfmCm() != null)
497 {
498 cmp = (cmp != 0 ? cmp : this.getPmfmCm().compareTo(o.getPmfmCm()));
499 }
500 if (this.getCreationDt() != null)
501 {
502 cmp = (cmp != 0 ? cmp : this.getCreationDt().compareTo(o.getCreationDt()));
503 }
504 }
505 return cmp;
506 }
507
508
509 }