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 fr.ifremer.quadrige3.core.vo.administration.program.ProgramVO;
32 import java.io.Serializable;
33 import java.sql.Timestamp;
34 import java.util.Arrays;
35 import java.util.Date;
36 import org.apache.commons.lang3.builder.CompareToBuilder;
37 import org.apache.commons.lang3.builder.EqualsBuilder;
38 import org.apache.commons.lang3.builder.HashCodeBuilder;
39 import org.apache.commons.lang3.builder.ToStringBuilder;
40
41
42
43
44 public class StrategyVO
45 implements Serializable, Comparable<StrategyVO>
46 {
47
48 private static final long serialVersionUID = -689132129716129621L;
49
50
51
52
53
54 protected Integer stratId;
55
56
57
58 protected String stratNm;
59
60
61
62 protected String stratDc;
63
64
65
66 protected Date stratCreationDt;
67
68
69
70 protected Timestamp updateDt;
71
72 protected String statusCd;
73
74 protected String progCd;
75
76 protected Integer[] respDepIds;
77
78 protected Integer[] respQuserIds;
79
80
81
82
83
84 protected ProgramVO programVO;
85
86
87
88
89 protected AppliedStrategyVO[] appliedStrategyVOs;
90
91
92
93
94
95 protected PmfmStrategyVO[] pmfmStrategyVOs;
96
97
98 public StrategyVO()
99 {
100
101 }
102
103
104
105
106
107
108
109
110
111
112
113 public StrategyVO(final Integer stratIdIn, final String stratNmIn, final String statusCdIn, final String progCdIn, final Integer[] respDepIdsIn, final Integer[] respQuserIdsIn, final ProgramVO programVOIn)
114 {
115 this.stratId = stratIdIn;
116 this.stratNm = stratNmIn;
117 this.statusCd = statusCdIn;
118 this.progCd = progCdIn;
119 this.respDepIds = respDepIdsIn;
120 this.respQuserIds = respQuserIdsIn;
121 this.programVO = programVOIn;
122 }
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139 public StrategyVO(final Integer stratIdIn, final String stratNmIn, final String stratDcIn, final Date stratCreationDtIn, final Timestamp updateDtIn, final String statusCdIn, final String progCdIn, final Integer[] respDepIdsIn, final Integer[] respQuserIdsIn, final ProgramVO programVOIn, final AppliedStrategyVO[] appliedStrategyVOsIn, final PmfmStrategyVO[] pmfmStrategyVOsIn)
140 {
141 this.stratId = stratIdIn;
142 this.stratNm = stratNmIn;
143 this.stratDc = stratDcIn;
144 this.stratCreationDt = stratCreationDtIn;
145 this.updateDt = updateDtIn;
146 this.statusCd = statusCdIn;
147 this.progCd = progCdIn;
148 this.respDepIds = respDepIdsIn;
149 this.respQuserIds = respQuserIdsIn;
150 this.programVO = programVOIn;
151 this.appliedStrategyVOs = appliedStrategyVOsIn;
152 this.pmfmStrategyVOs = pmfmStrategyVOsIn;
153 }
154
155
156
157
158
159
160
161 public StrategyVO(final StrategyVO otherBean)
162 {
163 this.stratId = otherBean.getStratId();
164 this.stratNm = otherBean.getStratNm();
165 this.stratDc = otherBean.getStratDc();
166 this.stratCreationDt = otherBean.getStratCreationDt();
167 this.updateDt = otherBean.getUpdateDt();
168 this.statusCd = otherBean.getStatusCd();
169 this.progCd = otherBean.getProgCd();
170 this.respDepIds = otherBean.getRespDepIds();
171 this.respQuserIds = otherBean.getRespQuserIds();
172 this.programVO = otherBean.getProgramVO();
173 this.appliedStrategyVOs = otherBean.getAppliedStrategyVOs();
174 this.pmfmStrategyVOs = otherBean.getPmfmStrategyVOs();
175 }
176
177
178
179
180
181 public void copy(final StrategyVO otherBean)
182 {
183 if (null != otherBean)
184 {
185 this.setStratId(otherBean.getStratId());
186 this.setStratNm(otherBean.getStratNm());
187 this.setStratDc(otherBean.getStratDc());
188 this.setStratCreationDt(otherBean.getStratCreationDt());
189 this.setUpdateDt(otherBean.getUpdateDt());
190 this.setStatusCd(otherBean.getStatusCd());
191 this.setProgCd(otherBean.getProgCd());
192 this.setRespDepIds(otherBean.getRespDepIds());
193 this.setRespQuserIds(otherBean.getRespQuserIds());
194 this.setProgramVO(otherBean.getProgramVO());
195 this.setAppliedStrategyVOs(otherBean.getAppliedStrategyVOs());
196 this.setPmfmStrategyVOs(otherBean.getPmfmStrategyVOs());
197 }
198 }
199
200
201
202
203
204
205 public Integer getStratId()
206 {
207 return this.stratId;
208 }
209
210
211
212
213
214 public void setStratId(final Integer value)
215 {
216 this.stratId = value;
217 }
218
219
220
221
222
223
224 public String getStratNm()
225 {
226 return this.stratNm;
227 }
228
229
230
231
232
233 public void setStratNm(final String value)
234 {
235 this.stratNm = value;
236 }
237
238
239
240
241
242
243 public String getStratDc()
244 {
245 return this.stratDc;
246 }
247
248
249
250
251
252 public void setStratDc(final String value)
253 {
254 this.stratDc = value;
255 }
256
257
258
259
260
261
262 public Date getStratCreationDt()
263 {
264 return this.stratCreationDt;
265 }
266
267
268
269
270
271 public void setStratCreationDt(final Date value)
272 {
273 this.stratCreationDt = value;
274 }
275
276
277
278
279
280
281 public Timestamp getUpdateDt()
282 {
283 return this.updateDt;
284 }
285
286
287
288
289
290 public void setUpdateDt(final Timestamp value)
291 {
292 this.updateDt = value;
293 }
294
295
296
297
298
299
300 public String getStatusCd()
301 {
302 return this.statusCd;
303 }
304
305
306
307
308
309 public void setStatusCd(final String value)
310 {
311 this.statusCd = value;
312 }
313
314
315
316
317
318
319 public String getProgCd()
320 {
321 return this.progCd;
322 }
323
324
325
326
327
328 public void setProgCd(final String value)
329 {
330 this.progCd = value;
331 }
332
333
334
335
336
337
338 public Integer[] getRespDepIds()
339 {
340 return this.respDepIds;
341 }
342
343
344
345
346
347 public void setRespDepIds(final Integer[] value)
348 {
349 this.respDepIds = value;
350 }
351
352
353
354
355
356
357 public Integer[] getRespQuserIds()
358 {
359 return this.respQuserIds;
360 }
361
362
363
364
365
366 public void setRespQuserIds(final Integer[] value)
367 {
368 this.respQuserIds = value;
369 }
370
371
372
373
374
375
376 public ProgramVO getProgramVO()
377 {
378 return this.programVO;
379 }
380
381
382
383
384
385 public void setProgramVO(ProgramVO value)
386 {
387 this.programVO = value;
388 }
389
390
391
392
393
394
395
396
397
398 public AppliedStrategyVO[] getAppliedStrategyVOs()
399 {
400 return this.appliedStrategyVOs;
401 }
402
403
404
405
406
407 public void setAppliedStrategyVOs(AppliedStrategyVO[] value)
408 {
409 this.appliedStrategyVOs = value;
410 }
411
412
413
414
415
416
417
418
419
420
421 public PmfmStrategyVO[] getPmfmStrategyVOs()
422 {
423 return this.pmfmStrategyVOs;
424 }
425
426
427
428
429
430 public void setPmfmStrategyVOs(PmfmStrategyVO[] value)
431 {
432 this.pmfmStrategyVOs = value;
433 }
434
435
436
437
438
439
440 @Override
441 public boolean equals(final Object object)
442 {
443 if (object==null || object.getClass() != this.getClass())
444 {
445 return false;
446 }
447
448 if (object==this)
449 {
450 return true;
451 }
452 StrategyVO rhs = (StrategyVO) object;
453 return new EqualsBuilder()
454 .append(this.getStratId(), rhs.getStratId())
455 .append(this.getStratNm(), rhs.getStratNm())
456 .append(this.getStratDc(), rhs.getStratDc())
457 .append(this.getStratCreationDt(), rhs.getStratCreationDt())
458 .append(this.getUpdateDt(), rhs.getUpdateDt())
459 .append(this.getStatusCd(), rhs.getStatusCd())
460 .append(this.getProgCd(), rhs.getProgCd())
461 .append(this.getRespDepIds(), rhs.getRespDepIds())
462 .append(this.getRespQuserIds(), rhs.getRespQuserIds())
463 .append(this.getProgramVO(), rhs.getProgramVO())
464 .append(this.getAppliedStrategyVOs(), rhs.getAppliedStrategyVOs())
465 .append(this.getPmfmStrategyVOs(), rhs.getPmfmStrategyVOs())
466 .isEquals();
467 }
468
469
470
471
472
473
474 public int compareTo(final StrategyVO object)
475 {
476 if (object==null)
477 {
478 return -1;
479 }
480
481 if (object==this)
482 {
483 return 0;
484 }
485 return new CompareToBuilder()
486 .append(this.getStratId(), object.getStratId())
487 .append(this.getStratNm(), object.getStratNm())
488 .append(this.getStratDc(), object.getStratDc())
489 .append(this.getStratCreationDt(), object.getStratCreationDt())
490 .append(this.getUpdateDt(), object.getUpdateDt())
491 .append(this.getStatusCd(), object.getStatusCd())
492 .append(this.getProgCd(), object.getProgCd())
493 .append(this.getRespDepIds(), object.getRespDepIds())
494 .append(this.getRespQuserIds(), object.getRespQuserIds())
495 .append(this.getProgramVO(), object.getProgramVO())
496 .append(this.getAppliedStrategyVOs(), object.getAppliedStrategyVOs())
497 .append(this.getPmfmStrategyVOs(), object.getPmfmStrategyVOs())
498 .toComparison();
499 }
500
501
502
503
504
505 @Override
506 public int hashCode()
507 {
508 return new HashCodeBuilder(1249046965, -82296885)
509 .append(this.getStratId())
510 .append(this.getStratNm())
511 .append(this.getStratDc())
512 .append(this.getStratCreationDt())
513 .append(this.getUpdateDt())
514 .append(this.getStatusCd())
515 .append(this.getProgCd())
516 .append(this.getRespDepIds())
517 .append(this.getRespQuserIds())
518 .append(this.getProgramVO())
519
520
521
522
523 .toHashCode();
524 }
525
526
527
528
529
530 @Override
531 public String toString()
532 {
533 return new ToStringBuilder(this)
534 .append("stratId", this.getStratId())
535 .append("stratNm", this.getStratNm())
536 .append("stratDc", this.getStratDc())
537 .append("stratCreationDt", this.getStratCreationDt())
538 .append("updateDt", this.getUpdateDt())
539 .append("statusCd", this.getStatusCd())
540 .append("progCd", this.getProgCd())
541 .append("respDepIds", this.getRespDepIds())
542 .append("respQuserIds", this.getRespQuserIds())
543 .append("programVO", this.getProgramVO())
544 .append("appliedStrategyVOs", this.getAppliedStrategyVOs())
545 .append("pmfmStrategyVOs", this.getPmfmStrategyVOs())
546 .toString();
547 }
548
549
550
551
552
553
554
555
556
557
558
559
560
561 protected static boolean equal(final Object first, final Object second)
562 {
563 final boolean equal;
564
565 if (first == null)
566 {
567 equal = (second == null);
568 }
569 else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
570 {
571 equal = Arrays.equals((Object[])first, (Object[])second);
572 }
573 else
574 {
575 equal = first.equals(second);
576 }
577
578 return equal;
579 }
580
581
582 }