1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package fr.ifremer.quadrige3.core.vo.administration.strategy;
30
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Arrays;
34 import org.apache.commons.lang3.builder.CompareToBuilder;
35 import org.apache.commons.lang3.builder.EqualsBuilder;
36 import org.apache.commons.lang3.builder.HashCodeBuilder;
37 import org.apache.commons.lang3.builder.ToStringBuilder;
38
39
40
41
42 public class AppliedStrategyVO
43 implements Serializable, Comparable<AppliedStrategyVO>
44 {
45
46 private static final long serialVersionUID = 7141714624259538612L;
47
48
49
50 protected Integer appliedStratId;
51
52
53
54 protected Timestamp updateDt;
55
56 protected String freqCd;
57
58 protected Integer monLocId;
59
60 protected Integer depId;
61
62 protected Integer taxonGroupId;
63
64 protected Integer refTaxonId;
65
66 protected Integer stratId;
67
68
69
70
71
72 protected PmfmAppliedStrategyVO[] pmfmAppliedStrategyVOs;
73
74
75
76
77 protected AppliedPeriodVO[] appliedPeriodVOs;
78
79
80
81
82 protected StrategyVO strategyVO;
83
84
85 public AppliedStrategyVO()
86 {
87
88 }
89
90
91
92
93
94
95
96 public AppliedStrategyVO(final Integer appliedStratIdIn, final Integer stratIdIn, final StrategyVO strategyVOIn)
97 {
98 this.appliedStratId = appliedStratIdIn;
99 this.stratId = stratIdIn;
100 this.strategyVO = strategyVOIn;
101 }
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117 public AppliedStrategyVO(final Integer appliedStratIdIn, final Timestamp updateDtIn, final String freqCdIn, final Integer monLocIdIn, final Integer depIdIn, final Integer taxonGroupIdIn, final Integer refTaxonIdIn, final Integer stratIdIn, final PmfmAppliedStrategyVO[] pmfmAppliedStrategyVOsIn, final AppliedPeriodVO[] appliedPeriodVOsIn, final StrategyVO strategyVOIn)
118 {
119 this.appliedStratId = appliedStratIdIn;
120 this.updateDt = updateDtIn;
121 this.freqCd = freqCdIn;
122 this.monLocId = monLocIdIn;
123 this.depId = depIdIn;
124 this.taxonGroupId = taxonGroupIdIn;
125 this.refTaxonId = refTaxonIdIn;
126 this.stratId = stratIdIn;
127 this.pmfmAppliedStrategyVOs = pmfmAppliedStrategyVOsIn;
128 this.appliedPeriodVOs = appliedPeriodVOsIn;
129 this.strategyVO = strategyVOIn;
130 }
131
132
133
134
135
136
137
138 public AppliedStrategyVO(final AppliedStrategyVO otherBean)
139 {
140 this.appliedStratId = otherBean.getAppliedStratId();
141 this.updateDt = otherBean.getUpdateDt();
142 this.freqCd = otherBean.getFreqCd();
143 this.monLocId = otherBean.getMonLocId();
144 this.depId = otherBean.getDepId();
145 this.taxonGroupId = otherBean.getTaxonGroupId();
146 this.refTaxonId = otherBean.getRefTaxonId();
147 this.stratId = otherBean.getStratId();
148 this.pmfmAppliedStrategyVOs = otherBean.getPmfmAppliedStrategyVOs();
149 this.appliedPeriodVOs = otherBean.getAppliedPeriodVOs();
150 this.strategyVO = otherBean.getStrategyVO();
151 }
152
153
154
155
156
157 public void copy(final AppliedStrategyVO otherBean)
158 {
159 if (null != otherBean)
160 {
161 this.setAppliedStratId(otherBean.getAppliedStratId());
162 this.setUpdateDt(otherBean.getUpdateDt());
163 this.setFreqCd(otherBean.getFreqCd());
164 this.setMonLocId(otherBean.getMonLocId());
165 this.setDepId(otherBean.getDepId());
166 this.setTaxonGroupId(otherBean.getTaxonGroupId());
167 this.setRefTaxonId(otherBean.getRefTaxonId());
168 this.setStratId(otherBean.getStratId());
169 this.setPmfmAppliedStrategyVOs(otherBean.getPmfmAppliedStrategyVOs());
170 this.setAppliedPeriodVOs(otherBean.getAppliedPeriodVOs());
171 this.setStrategyVO(otherBean.getStrategyVO());
172 }
173 }
174
175
176
177
178
179
180 public Integer getAppliedStratId()
181 {
182 return this.appliedStratId;
183 }
184
185
186
187
188
189 public void setAppliedStratId(final Integer value)
190 {
191 this.appliedStratId = value;
192 }
193
194
195
196
197
198
199 public Timestamp getUpdateDt()
200 {
201 return this.updateDt;
202 }
203
204
205
206
207
208 public void setUpdateDt(final Timestamp value)
209 {
210 this.updateDt = value;
211 }
212
213
214
215
216
217
218 public String getFreqCd()
219 {
220 return this.freqCd;
221 }
222
223
224
225
226
227 public void setFreqCd(final String value)
228 {
229 this.freqCd = value;
230 }
231
232
233
234
235
236
237 public Integer getMonLocId()
238 {
239 return this.monLocId;
240 }
241
242
243
244
245
246 public void setMonLocId(final Integer value)
247 {
248 this.monLocId = value;
249 }
250
251
252
253
254
255
256 public Integer getDepId()
257 {
258 return this.depId;
259 }
260
261
262
263
264
265 public void setDepId(final Integer value)
266 {
267 this.depId = value;
268 }
269
270
271
272
273
274
275 public Integer getTaxonGroupId()
276 {
277 return this.taxonGroupId;
278 }
279
280
281
282
283
284 public void setTaxonGroupId(final Integer value)
285 {
286 this.taxonGroupId = value;
287 }
288
289
290
291
292
293
294 public Integer getRefTaxonId()
295 {
296 return this.refTaxonId;
297 }
298
299
300
301
302
303 public void setRefTaxonId(final Integer value)
304 {
305 this.refTaxonId = value;
306 }
307
308
309
310
311
312
313 public Integer getStratId()
314 {
315 return this.stratId;
316 }
317
318
319
320
321
322 public void setStratId(final Integer value)
323 {
324 this.stratId = value;
325 }
326
327
328
329
330
331
332
333
334
335 public PmfmAppliedStrategyVO[] getPmfmAppliedStrategyVOs()
336 {
337 return this.pmfmAppliedStrategyVOs;
338 }
339
340
341
342
343
344 public void setPmfmAppliedStrategyVOs(PmfmAppliedStrategyVO[] value)
345 {
346 this.pmfmAppliedStrategyVOs = value;
347 }
348
349
350
351
352
353
354
355
356
357 public AppliedPeriodVO[] getAppliedPeriodVOs()
358 {
359 return this.appliedPeriodVOs;
360 }
361
362
363
364
365
366 public void setAppliedPeriodVOs(AppliedPeriodVO[] value)
367 {
368 this.appliedPeriodVOs = value;
369 }
370
371
372
373
374
375
376 public StrategyVO getStrategyVO()
377 {
378 return this.strategyVO;
379 }
380
381
382
383
384
385 public void setStrategyVO(StrategyVO value)
386 {
387 this.strategyVO = value;
388 }
389
390
391
392
393
394
395 @Override
396 public boolean equals(final Object object)
397 {
398 if (object==null || object.getClass() != this.getClass())
399 {
400 return false;
401 }
402
403 if (object==this)
404 {
405 return true;
406 }
407 AppliedStrategyVO rhs = (AppliedStrategyVO) object;
408 return new EqualsBuilder()
409 .append(this.getAppliedStratId(), rhs.getAppliedStratId())
410 .append(this.getUpdateDt(), rhs.getUpdateDt())
411 .append(this.getFreqCd(), rhs.getFreqCd())
412 .append(this.getMonLocId(), rhs.getMonLocId())
413 .append(this.getDepId(), rhs.getDepId())
414 .append(this.getTaxonGroupId(), rhs.getTaxonGroupId())
415 .append(this.getRefTaxonId(), rhs.getRefTaxonId())
416 .append(this.getStratId(), rhs.getStratId())
417 .append(this.getPmfmAppliedStrategyVOs(), rhs.getPmfmAppliedStrategyVOs())
418 .append(this.getAppliedPeriodVOs(), rhs.getAppliedPeriodVOs())
419 .append(this.getStrategyVO(), rhs.getStrategyVO())
420 .isEquals();
421 }
422
423
424
425
426
427
428 public int compareTo(final AppliedStrategyVO object)
429 {
430 if (object==null)
431 {
432 return -1;
433 }
434
435 if (object==this)
436 {
437 return 0;
438 }
439 return new CompareToBuilder()
440 .append(this.getAppliedStratId(), object.getAppliedStratId())
441 .append(this.getUpdateDt(), object.getUpdateDt())
442 .append(this.getFreqCd(), object.getFreqCd())
443 .append(this.getMonLocId(), object.getMonLocId())
444 .append(this.getDepId(), object.getDepId())
445 .append(this.getTaxonGroupId(), object.getTaxonGroupId())
446 .append(this.getRefTaxonId(), object.getRefTaxonId())
447 .append(this.getStratId(), object.getStratId())
448 .append(this.getPmfmAppliedStrategyVOs(), object.getPmfmAppliedStrategyVOs())
449 .append(this.getAppliedPeriodVOs(), object.getAppliedPeriodVOs())
450 .append(this.getStrategyVO(), object.getStrategyVO())
451 .toComparison();
452 }
453
454
455
456
457
458 @Override
459 public int hashCode()
460 {
461 return new HashCodeBuilder(1249046965, -82296885)
462 .append(this.getAppliedStratId())
463 .append(this.getUpdateDt())
464 .append(this.getFreqCd())
465 .append(this.getMonLocId())
466 .append(this.getDepId())
467 .append(this.getTaxonGroupId())
468 .append(this.getRefTaxonId())
469 .append(this.getStratId())
470
471
472
473
474 .append(this.getStrategyVO())
475 .toHashCode();
476 }
477
478
479
480
481
482 @Override
483 public String toString()
484 {
485 return new ToStringBuilder(this)
486 .append("appliedStratId", this.getAppliedStratId())
487 .append("updateDt", this.getUpdateDt())
488 .append("freqCd", this.getFreqCd())
489 .append("monLocId", this.getMonLocId())
490 .append("depId", this.getDepId())
491 .append("taxonGroupId", this.getTaxonGroupId())
492 .append("refTaxonId", this.getRefTaxonId())
493 .append("stratId", this.getStratId())
494 .append("pmfmAppliedStrategyVOs", this.getPmfmAppliedStrategyVOs())
495 .append("appliedPeriodVOs", this.getAppliedPeriodVOs())
496 .append("strategyVO", this.getStrategyVO())
497 .toString();
498 }
499
500
501
502
503
504
505
506
507
508
509
510
511
512 protected static boolean equal(final Object first, final Object second)
513 {
514 final boolean equal;
515
516 if (first == null)
517 {
518 equal = (second == null);
519 }
520 else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
521 {
522 equal = Arrays.equals((Object[])first, (Object[])second);
523 }
524 else
525 {
526 equal = first.equals(second);
527 }
528
529 return equal;
530 }
531
532
533 }