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 fr.ifremer.quadrige2.core.dao.referential.Unit;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
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 = -8946502882132003441L;
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 Integer pmfmMaximumNumberDecimals;
70
71
72
73
74
75
76 public Integer getPmfmMaximumNumberDecimals()
77 {
78 return this.pmfmMaximumNumberDecimals;
79 }
80
81
82
83
84
85
86 public void setPmfmMaximumNumberDecimals(Integer pmfmMaximumNumberDecimalsIn)
87 {
88 this.pmfmMaximumNumberDecimals = pmfmMaximumNumberDecimalsIn;
89 }
90
91 private Integer pmfmSignifFiguresNumber;
92
93
94
95
96
97 public Integer getPmfmSignifFiguresNumber()
98 {
99 return this.pmfmSignifFiguresNumber;
100 }
101
102
103
104
105
106 public void setPmfmSignifFiguresNumber(Integer 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
152 private Unit unit;
153
154
155
156
157
158 public Unit getUnit()
159 {
160 return this.unit;
161 }
162
163
164
165
166
167 public void setUnit(Unit unitIn)
168 {
169 this.unit = unitIn;
170 }
171
172 private Matrix matrix;
173
174
175
176
177
178 public Matrix getMatrix()
179 {
180 return this.matrix;
181 }
182
183
184
185
186
187 public void setMatrix(Matrix matrixIn)
188 {
189 this.matrix = matrixIn;
190 }
191
192 private Fraction fraction;
193
194
195
196
197
198 public Fraction getFraction()
199 {
200 return this.fraction;
201 }
202
203
204
205
206
207 public void setFraction(Fraction fractionIn)
208 {
209 this.fraction = fractionIn;
210 }
211
212 private Parameter parameter;
213
214
215
216
217
218 public Parameter getParameter()
219 {
220 return this.parameter;
221 }
222
223
224
225
226
227 public void setParameter(Parameter parameterIn)
228 {
229 this.parameter = parameterIn;
230 }
231
232 private Method method;
233
234
235
236
237
238 public Method getMethod()
239 {
240 return this.method;
241 }
242
243
244
245
246
247 public void setMethod(Method methodIn)
248 {
249 this.method = methodIn;
250 }
251
252 private Status status;
253
254
255
256
257
258 public Status getStatus()
259 {
260 return this.status;
261 }
262
263
264
265
266
267 public void setStatus(Status statusIn)
268 {
269 this.status = statusIn;
270 }
271
272 private Collection<PmfmQualValue> pmfmQualValues = new HashSet<PmfmQualValue>();
273
274
275
276
277
278
279 public Collection<PmfmQualValue> getPmfmQualValues()
280 {
281 return this.pmfmQualValues;
282 }
283
284
285
286
287
288
289 public void setPmfmQualValues(Collection<PmfmQualValue> pmfmQualValuesIn)
290 {
291 this.pmfmQualValues = pmfmQualValuesIn;
292 }
293
294
295
296
297
298
299
300
301 public boolean addPmfmQualValues(PmfmQualValue elementToAdd)
302 {
303 return this.pmfmQualValues.add(elementToAdd);
304 }
305
306
307
308
309
310
311
312
313 public boolean removePmfmQualValues(PmfmQualValue elementToRemove)
314 {
315 return this.pmfmQualValues.remove(elementToRemove);
316 }
317
318
319
320
321
322 @Override
323 public boolean equals(Object object)
324 {
325 if (this == object)
326 {
327 return true;
328 }
329 if (!(object instanceof Pmfm))
330 {
331 return false;
332 }
333 final Pmfm that = (Pmfm)object;
334 if (this.pmfmId == null || that.getPmfmId() == null || !this.pmfmId.equals(that.getPmfmId()))
335 {
336 return false;
337 }
338 return true;
339 }
340
341
342
343
344 @Override
345 public int hashCode()
346 {
347 int hashCode = 0;
348 hashCode = 29 * hashCode + (this.pmfmId == null ? 0 : this.pmfmId.hashCode());
349
350 return hashCode;
351 }
352
353
354
355
356 public static final class Factory
357 {
358
359
360
361
362 public static Pmfm newInstance()
363 {
364 return new PmfmImpl();
365 }
366
367
368
369
370
371
372
373
374
375
376
377
378
379 public static Pmfm newInstance(Timestamp updateDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status)
380 {
381 final Pmfm entity = new PmfmImpl();
382 entity.setUpdateDt(updateDt);
383 entity.setUnit(unit);
384 entity.setMatrix(matrix);
385 entity.setFraction(fraction);
386 entity.setParameter(parameter);
387 entity.setMethod(method);
388 entity.setStatus(status);
389 return entity;
390 }
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408 public static Pmfm newInstance(Float pmfmDetectionThreshold, Integer pmfmMaximumNumberDecimals, Integer pmfmSignifFiguresNumber, Timestamp updateDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status, Collection<PmfmQualValue> pmfmQualValues)
409 {
410 final Pmfm entity = new PmfmImpl();
411 entity.setPmfmDetectionThreshold(pmfmDetectionThreshold);
412 entity.setPmfmMaximumNumberDecimals(pmfmMaximumNumberDecimals);
413 entity.setPmfmSignifFiguresNumber(pmfmSignifFiguresNumber);
414 entity.setUpdateDt(updateDt);
415 entity.setUnit(unit);
416 entity.setMatrix(matrix);
417 entity.setFraction(fraction);
418 entity.setParameter(parameter);
419 entity.setMethod(method);
420 entity.setStatus(status);
421 entity.setPmfmQualValues(pmfmQualValues);
422 return entity;
423 }
424 }
425
426
427
428
429 public int compareTo(Pmfm o)
430 {
431 int cmp = 0;
432 if (this.getPmfmId() != null)
433 {
434 cmp = this.getPmfmId().compareTo(o.getPmfmId());
435 }
436 else
437 {
438 if (this.getPmfmDetectionThreshold() != null)
439 {
440 cmp = (cmp != 0 ? cmp : this.getPmfmDetectionThreshold().compareTo(o.getPmfmDetectionThreshold()));
441 }
442 if (this.getPmfmMaximumNumberDecimals() != null)
443 {
444 cmp = (cmp != 0 ? cmp : this.getPmfmMaximumNumberDecimals().compareTo(o.getPmfmMaximumNumberDecimals()));
445 }
446 if (this.getPmfmSignifFiguresNumber() != null)
447 {
448 cmp = (cmp != 0 ? cmp : this.getPmfmSignifFiguresNumber().compareTo(o.getPmfmSignifFiguresNumber()));
449 }
450 if (this.getUpdateDt() != null)
451 {
452 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
453 }
454 }
455 return cmp;
456 }
457
458
459 }