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