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.quadrige2.core.vo.system.rule;
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 RuleVO
43 implements Serializable, Comparable<RuleVO>
44 {
45
46 private static final long serialVersionUID = 9147838804589316449L;
47
48
49
50 protected String ruleCd;
51
52 protected String ruleControledAttribut;
53
54 protected String ruleDc;
55
56 protected String ruleIsActive;
57
58 protected String ruleIsBlocking;
59
60 protected String ruleErrorMsg;
61
62 protected Timestamp updateDt;
63
64 protected String ruleListCd;
65
66 protected Integer functionId;
67
68
69
70 protected RuleParameterVO[] ruleParameterVOs;
71
72
73 protected RuleListVO ruleListVO;
74
75
76 protected RulePmfmVO[] rulePmfmVOs;
77
78
79 public RuleVO()
80 {
81
82 }
83
84
85
86
87
88
89
90
91
92 public RuleVO(final String ruleCdIn, final String ruleControledAttributIn, final String ruleListCdIn, final Integer functionIdIn, final RuleListVO ruleListVOIn)
93 {
94 this.ruleCd = ruleCdIn;
95 this.ruleControledAttribut = ruleControledAttributIn;
96 this.ruleListCd = ruleListCdIn;
97 this.functionId = functionIdIn;
98 this.ruleListVO = ruleListVOIn;
99 }
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116 public RuleVO(final String ruleCdIn, final String ruleControledAttributIn, final String ruleDcIn, final String ruleIsActiveIn, final String ruleIsBlockingIn, final String ruleErrorMsgIn, final Timestamp updateDtIn, final String ruleListCdIn, final Integer functionIdIn, final RuleParameterVO[] ruleParameterVOsIn, final RuleListVO ruleListVOIn, final RulePmfmVO[] rulePmfmVOsIn)
117 {
118 this.ruleCd = ruleCdIn;
119 this.ruleControledAttribut = ruleControledAttributIn;
120 this.ruleDc = ruleDcIn;
121 this.ruleIsActive = ruleIsActiveIn;
122 this.ruleIsBlocking = ruleIsBlockingIn;
123 this.ruleErrorMsg = ruleErrorMsgIn;
124 this.updateDt = updateDtIn;
125 this.ruleListCd = ruleListCdIn;
126 this.functionId = functionIdIn;
127 this.ruleParameterVOs = ruleParameterVOsIn;
128 this.ruleListVO = ruleListVOIn;
129 this.rulePmfmVOs = rulePmfmVOsIn;
130 }
131
132
133
134
135
136
137
138 public RuleVO(final RuleVO otherBean)
139 {
140 this.ruleCd = otherBean.getRuleCd();
141 this.ruleControledAttribut = otherBean.getRuleControledAttribut();
142 this.ruleDc = otherBean.getRuleDc();
143 this.ruleIsActive = otherBean.getRuleIsActive();
144 this.ruleIsBlocking = otherBean.getRuleIsBlocking();
145 this.ruleErrorMsg = otherBean.getRuleErrorMsg();
146 this.updateDt = otherBean.getUpdateDt();
147 this.ruleListCd = otherBean.getRuleListCd();
148 this.functionId = otherBean.getFunctionId();
149 this.ruleParameterVOs = otherBean.getRuleParameterVOs();
150 this.ruleListVO = otherBean.getRuleListVO();
151 this.rulePmfmVOs = otherBean.getRulePmfmVOs();
152 }
153
154
155
156
157
158 public void copy(final RuleVO otherBean)
159 {
160 if (null != otherBean)
161 {
162 this.setRuleCd(otherBean.getRuleCd());
163 this.setRuleControledAttribut(otherBean.getRuleControledAttribut());
164 this.setRuleDc(otherBean.getRuleDc());
165 this.setRuleIsActive(otherBean.getRuleIsActive());
166 this.setRuleIsBlocking(otherBean.getRuleIsBlocking());
167 this.setRuleErrorMsg(otherBean.getRuleErrorMsg());
168 this.setUpdateDt(otherBean.getUpdateDt());
169 this.setRuleListCd(otherBean.getRuleListCd());
170 this.setFunctionId(otherBean.getFunctionId());
171 this.setRuleParameterVOs(otherBean.getRuleParameterVOs());
172 this.setRuleListVO(otherBean.getRuleListVO());
173 this.setRulePmfmVOs(otherBean.getRulePmfmVOs());
174 }
175 }
176
177
178
179
180
181
182 public String getRuleCd()
183 {
184 return this.ruleCd;
185 }
186
187
188
189
190
191 public void setRuleCd(final String value)
192 {
193 this.ruleCd = value;
194 }
195
196
197
198
199
200
201 public String getRuleControledAttribut()
202 {
203 return this.ruleControledAttribut;
204 }
205
206
207
208
209
210 public void setRuleControledAttribut(final String value)
211 {
212 this.ruleControledAttribut = value;
213 }
214
215
216
217
218
219
220 public String getRuleDc()
221 {
222 return this.ruleDc;
223 }
224
225
226
227
228
229 public void setRuleDc(final String value)
230 {
231 this.ruleDc = value;
232 }
233
234
235
236
237
238
239 public String getRuleIsActive()
240 {
241 return this.ruleIsActive;
242 }
243
244
245
246
247
248 public void setRuleIsActive(final String value)
249 {
250 this.ruleIsActive = value;
251 }
252
253
254
255
256
257
258 public String getRuleIsBlocking()
259 {
260 return this.ruleIsBlocking;
261 }
262
263
264
265
266
267 public void setRuleIsBlocking(final String value)
268 {
269 this.ruleIsBlocking = value;
270 }
271
272
273
274
275
276
277 public String getRuleErrorMsg()
278 {
279 return this.ruleErrorMsg;
280 }
281
282
283
284
285
286 public void setRuleErrorMsg(final String value)
287 {
288 this.ruleErrorMsg = value;
289 }
290
291
292
293
294
295
296 public Timestamp getUpdateDt()
297 {
298 return this.updateDt;
299 }
300
301
302
303
304
305 public void setUpdateDt(final Timestamp value)
306 {
307 this.updateDt = value;
308 }
309
310
311
312
313
314
315 public String getRuleListCd()
316 {
317 return this.ruleListCd;
318 }
319
320
321
322
323
324 public void setRuleListCd(final String value)
325 {
326 this.ruleListCd = value;
327 }
328
329
330
331
332
333
334 public Integer getFunctionId()
335 {
336 return this.functionId;
337 }
338
339
340
341
342
343 public void setFunctionId(final Integer value)
344 {
345 this.functionId = value;
346 }
347
348
349
350
351
352
353
354
355
356 public RuleParameterVO[] getRuleParameterVOs()
357 {
358 return this.ruleParameterVOs;
359 }
360
361
362
363
364
365 public void setRuleParameterVOs(RuleParameterVO[] value)
366 {
367 this.ruleParameterVOs = value;
368 }
369
370
371
372
373
374
375 public RuleListVO getRuleListVO()
376 {
377 return this.ruleListVO;
378 }
379
380
381
382
383
384 public void setRuleListVO(RuleListVO value)
385 {
386 this.ruleListVO = value;
387 }
388
389
390
391
392
393
394
395
396
397 public RulePmfmVO[] getRulePmfmVOs()
398 {
399 return this.rulePmfmVOs;
400 }
401
402
403
404
405
406 public void setRulePmfmVOs(RulePmfmVO[] value)
407 {
408 this.rulePmfmVOs = value;
409 }
410
411
412
413
414
415
416 @Override
417 public boolean equals(final Object object)
418 {
419 if (object==null || object.getClass() != this.getClass())
420 {
421 return false;
422 }
423
424 if (object==this)
425 {
426 return true;
427 }
428 RuleVO rhs = (RuleVO) object;
429 return new EqualsBuilder()
430 .append(this.getRuleCd(), rhs.getRuleCd())
431 .append(this.getRuleControledAttribut(), rhs.getRuleControledAttribut())
432 .append(this.getRuleDc(), rhs.getRuleDc())
433 .append(this.getRuleIsActive(), rhs.getRuleIsActive())
434 .append(this.getRuleIsBlocking(), rhs.getRuleIsBlocking())
435 .append(this.getRuleErrorMsg(), rhs.getRuleErrorMsg())
436 .append(this.getUpdateDt(), rhs.getUpdateDt())
437 .append(this.getRuleListCd(), rhs.getRuleListCd())
438 .append(this.getFunctionId(), rhs.getFunctionId())
439 .append(this.getRuleParameterVOs(), rhs.getRuleParameterVOs())
440 .append(this.getRuleListVO(), rhs.getRuleListVO())
441 .append(this.getRulePmfmVOs(), rhs.getRulePmfmVOs())
442 .isEquals();
443 }
444
445
446
447
448
449
450 public int compareTo(final RuleVO object)
451 {
452 if (object==null)
453 {
454 return -1;
455 }
456
457 if (object==this)
458 {
459 return 0;
460 }
461 return new CompareToBuilder()
462 .append(this.getRuleCd(), object.getRuleCd())
463 .append(this.getRuleControledAttribut(), object.getRuleControledAttribut())
464 .append(this.getRuleDc(), object.getRuleDc())
465 .append(this.getRuleIsActive(), object.getRuleIsActive())
466 .append(this.getRuleIsBlocking(), object.getRuleIsBlocking())
467 .append(this.getRuleErrorMsg(), object.getRuleErrorMsg())
468 .append(this.getUpdateDt(), object.getUpdateDt())
469 .append(this.getRuleListCd(), object.getRuleListCd())
470 .append(this.getFunctionId(), object.getFunctionId())
471 .append(this.getRuleParameterVOs(), object.getRuleParameterVOs())
472 .append(this.getRuleListVO(), object.getRuleListVO())
473 .append(this.getRulePmfmVOs(), object.getRulePmfmVOs())
474 .toComparison();
475 }
476
477
478
479
480
481 @Override
482 public int hashCode()
483 {
484 return new HashCodeBuilder(1249046965, -82296885)
485 .append(this.getRuleCd())
486 .append(this.getRuleControledAttribut())
487 .append(this.getRuleDc())
488 .append(this.getRuleIsActive())
489 .append(this.getRuleIsBlocking())
490 .append(this.getRuleErrorMsg())
491 .append(this.getUpdateDt())
492 .append(this.getRuleListCd())
493 .append(this.getFunctionId())
494
495
496 .append(this.getRuleListVO())
497
498
499 .toHashCode();
500 }
501
502
503
504
505
506 @Override
507 public String toString()
508 {
509 return new ToStringBuilder(this)
510 .append("ruleCd", this.getRuleCd())
511 .append("ruleControledAttribut", this.getRuleControledAttribut())
512 .append("ruleDc", this.getRuleDc())
513 .append("ruleIsActive", this.getRuleIsActive())
514 .append("ruleIsBlocking", this.getRuleIsBlocking())
515 .append("ruleErrorMsg", this.getRuleErrorMsg())
516 .append("updateDt", this.getUpdateDt())
517 .append("ruleListCd", this.getRuleListCd())
518 .append("functionId", this.getFunctionId())
519 .append("ruleParameterVOs", this.getRuleParameterVOs())
520 .append("ruleListVO", this.getRuleListVO())
521 .append("rulePmfmVOs", this.getRulePmfmVOs())
522 .toString();
523 }
524
525
526
527
528
529
530
531
532
533
534
535
536
537 protected static boolean equal(final Object first, final Object second)
538 {
539 final boolean equal;
540
541 if (first == null)
542 {
543 equal = (second == null);
544 }
545 else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
546 {
547 equal = Arrays.equals((Object[])first, (Object[])second);
548 }
549 else
550 {
551 equal = first.equals(second);
552 }
553
554 return equal;
555 }
556
557
558 }