1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.administration.strategy;
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.AcquisitionLevel;
30 import fr.ifremer.quadrige2.core.dao.referential.PrecisionType;
31 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Pmfm;
32 import java.io.Serializable;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.HashSet;
36
37
38
39
40
41
42 public abstract class PmfmStrategy
43 implements Serializable, Comparable<PmfmStrategy>
44 {
45
46
47
48 private static final long serialVersionUID = 6770525363219752117L;
49
50
51 private Integer pmfmStratId;
52
53
54
55
56
57 public Integer getPmfmStratId()
58 {
59 return this.pmfmStratId;
60 }
61
62
63
64
65
66 public void setPmfmStratId(Integer pmfmStratIdIn)
67 {
68 this.pmfmStratId = pmfmStratIdIn;
69 }
70
71 private Double pmfmStratParAcquisNumber;
72
73
74
75
76
77
78
79 public Double getPmfmStratParAcquisNumber()
80 {
81 return this.pmfmStratParAcquisNumber;
82 }
83
84
85
86
87
88
89
90 public void setPmfmStratParAcquisNumber(Double pmfmStratParAcquisNumberIn)
91 {
92 this.pmfmStratParAcquisNumber = pmfmStratParAcquisNumberIn;
93 }
94
95 private Integer pmfmStratPresRk;
96
97
98
99
100
101 public Integer getPmfmStratPresRk()
102 {
103 return this.pmfmStratPresRk;
104 }
105
106
107
108
109
110 public void setPmfmStratPresRk(Integer pmfmStratPresRkIn)
111 {
112 this.pmfmStratPresRk = pmfmStratPresRkIn;
113 }
114
115 private String pmfmStratParIsIndiv;
116
117
118
119
120
121 public String getPmfmStratParIsIndiv()
122 {
123 return this.pmfmStratParIsIndiv;
124 }
125
126
127
128
129
130 public void setPmfmStratParIsIndiv(String pmfmStratParIsIndivIn)
131 {
132 this.pmfmStratParIsIndiv = pmfmStratParIsIndivIn;
133 }
134
135 private String pmfmStratIsUniqueByTaxon;
136
137
138
139
140
141 public String getPmfmStratIsUniqueByTaxon()
142 {
143 return this.pmfmStratIsUniqueByTaxon;
144 }
145
146
147
148
149
150 public void setPmfmStratIsUniqueByTaxon(String pmfmStratIsUniqueByTaxonIn)
151 {
152 this.pmfmStratIsUniqueByTaxon = pmfmStratIsUniqueByTaxonIn;
153 }
154
155 private Timestamp updateDt;
156
157
158
159
160
161 public Timestamp getUpdateDt()
162 {
163 return this.updateDt;
164 }
165
166
167
168
169
170 public void setUpdateDt(Timestamp updateDtIn)
171 {
172 this.updateDt = updateDtIn;
173 }
174
175
176 private Collection<UiFunction> uiFunctions = new HashSet<UiFunction>();
177
178
179
180
181
182
183
184 public Collection<UiFunction> getUiFunctions()
185 {
186 return this.uiFunctions;
187 }
188
189
190
191
192
193
194
195 public void setUiFunctions(Collection<UiFunction> uiFunctionsIn)
196 {
197 this.uiFunctions = uiFunctionsIn;
198 }
199
200
201
202
203
204
205
206
207
208 public boolean addUiFunctions(UiFunction elementToAdd)
209 {
210 return this.uiFunctions.add(elementToAdd);
211 }
212
213
214
215
216
217
218
219
220
221 public boolean removeUiFunctions(UiFunction elementToRemove)
222 {
223 return this.uiFunctions.remove(elementToRemove);
224 }
225
226 private Pmfm pmfm;
227
228
229
230
231
232 public Pmfm getPmfm()
233 {
234 return this.pmfm;
235 }
236
237
238
239
240
241 public void setPmfm(Pmfm pmfmIn)
242 {
243 this.pmfm = pmfmIn;
244 }
245
246 private PrecisionType precisionType;
247
248
249
250
251
252 public PrecisionType getPrecisionType()
253 {
254 return this.precisionType;
255 }
256
257
258
259
260
261 public void setPrecisionType(PrecisionType precisionTypeIn)
262 {
263 this.precisionType = precisionTypeIn;
264 }
265
266 private Strategy strategy;
267
268
269
270
271
272 public Strategy getStrategy()
273 {
274 return this.strategy;
275 }
276
277
278
279
280
281 public void setStrategy(Strategy strategyIn)
282 {
283 this.strategy = strategyIn;
284 }
285
286 private Collection<AcquisitionLevel> acquisitionLevels = new HashSet<AcquisitionLevel>();
287
288
289
290
291
292 public Collection<AcquisitionLevel> getAcquisitionLevels()
293 {
294 return this.acquisitionLevels;
295 }
296
297
298
299
300
301 public void setAcquisitionLevels(Collection<AcquisitionLevel> acquisitionLevelsIn)
302 {
303 this.acquisitionLevels = acquisitionLevelsIn;
304 }
305
306
307
308
309
310
311
312 public boolean addAcquisitionLevels(AcquisitionLevel elementToAdd)
313 {
314 return this.acquisitionLevels.add(elementToAdd);
315 }
316
317
318
319
320
321
322
323 public boolean removeAcquisitionLevels(AcquisitionLevel elementToRemove)
324 {
325 return this.acquisitionLevels.remove(elementToRemove);
326 }
327
328
329
330
331
332 @Override
333 public boolean equals(Object object)
334 {
335 if (this == object)
336 {
337 return true;
338 }
339 if (!(object instanceof PmfmStrategy))
340 {
341 return false;
342 }
343 final PmfmStrategy that = (PmfmStrategy)object;
344 if (this.pmfmStratId == null || that.getPmfmStratId() == null || !this.pmfmStratId.equals(that.getPmfmStratId()))
345 {
346 return false;
347 }
348 return true;
349 }
350
351
352
353
354 @Override
355 public int hashCode()
356 {
357 int hashCode = 0;
358 hashCode = 29 * hashCode + (this.pmfmStratId == null ? 0 : this.pmfmStratId.hashCode());
359
360 return hashCode;
361 }
362
363
364
365
366 public static final class Factory
367 {
368
369
370
371
372 public static PmfmStrategy newInstance()
373 {
374 return new PmfmStrategyImpl();
375 }
376
377
378
379
380
381
382
383
384
385
386 public static PmfmStrategy newInstance(Double pmfmStratParAcquisNumber, Timestamp updateDt, Pmfm pmfm, Strategy strategy)
387 {
388 final PmfmStrategy entity = new PmfmStrategyImpl();
389 entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
390 entity.setUpdateDt(updateDt);
391 entity.setPmfm(pmfm);
392 entity.setStrategy(strategy);
393 return entity;
394 }
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411 public static PmfmStrategy newInstance(Double pmfmStratParAcquisNumber, Integer pmfmStratPresRk, String pmfmStratParIsIndiv, String pmfmStratIsUniqueByTaxon, Timestamp updateDt, Collection<UiFunction> uiFunctions, Pmfm pmfm, PrecisionType precisionType, Strategy strategy, Collection<AcquisitionLevel> acquisitionLevels)
412 {
413 final PmfmStrategy entity = new PmfmStrategyImpl();
414 entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
415 entity.setPmfmStratPresRk(pmfmStratPresRk);
416 entity.setPmfmStratParIsIndiv(pmfmStratParIsIndiv);
417 entity.setPmfmStratIsUniqueByTaxon(pmfmStratIsUniqueByTaxon);
418 entity.setUpdateDt(updateDt);
419 entity.setUiFunctions(uiFunctions);
420 entity.setPmfm(pmfm);
421 entity.setPrecisionType(precisionType);
422 entity.setStrategy(strategy);
423 entity.setAcquisitionLevels(acquisitionLevels);
424 return entity;
425 }
426 }
427
428
429
430
431 public int compareTo(PmfmStrategy o)
432 {
433 int cmp = 0;
434 if (this.getPmfmStratId() != null)
435 {
436 cmp = this.getPmfmStratId().compareTo(o.getPmfmStratId());
437 }
438 else
439 {
440 if (this.getPmfmStratParAcquisNumber() != null)
441 {
442 cmp = (cmp != 0 ? cmp : this.getPmfmStratParAcquisNumber().compareTo(o.getPmfmStratParAcquisNumber()));
443 }
444 if (this.getPmfmStratPresRk() != null)
445 {
446 cmp = (cmp != 0 ? cmp : this.getPmfmStratPresRk().compareTo(o.getPmfmStratPresRk()));
447 }
448 if (this.getPmfmStratParIsIndiv() != null)
449 {
450 cmp = (cmp != 0 ? cmp : this.getPmfmStratParIsIndiv().compareTo(o.getPmfmStratParIsIndiv()));
451 }
452 if (this.getPmfmStratIsUniqueByTaxon() != null)
453 {
454 cmp = (cmp != 0 ? cmp : this.getPmfmStratIsUniqueByTaxon().compareTo(o.getPmfmStratIsUniqueByTaxon()));
455 }
456 if (this.getUpdateDt() != null)
457 {
458 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
459 }
460 }
461 return cmp;
462 }
463
464
465 }