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