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