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 RulePreconditionVO
43 implements Serializable, Comparable<RulePreconditionVO>
44 {
45
46 private static final long serialVersionUID = 1281007992127533019L;
47
48
49
50 protected Integer rulePrecondId;
51
52 protected String rulePrecondLb;
53
54 protected String rulePrecondIsBidir;
55
56 protected String rulePrecondIsActive;
57
58 protected Timestamp updateDt;
59
60 protected String ruleCd;
61
62 protected String usedRuleCd;
63
64
65
66 protected RuleVO ruleVO;
67
68
69 public RulePreconditionVO()
70 {
71
72 }
73
74
75
76
77
78
79
80
81
82
83
84 public RulePreconditionVO(final Integer rulePrecondIdIn, final String rulePrecondLbIn, final String rulePrecondIsBidirIn, final String rulePrecondIsActiveIn, final String ruleCdIn, final String usedRuleCdIn, final RuleVO ruleVOIn)
85 {
86 this.rulePrecondId = rulePrecondIdIn;
87 this.rulePrecondLb = rulePrecondLbIn;
88 this.rulePrecondIsBidir = rulePrecondIsBidirIn;
89 this.rulePrecondIsActive = rulePrecondIsActiveIn;
90 this.ruleCd = ruleCdIn;
91 this.usedRuleCd = usedRuleCdIn;
92 this.ruleVO = ruleVOIn;
93 }
94
95
96
97
98
99
100
101
102
103
104
105
106 public RulePreconditionVO(final Integer rulePrecondIdIn, final String rulePrecondLbIn, final String rulePrecondIsBidirIn, final String rulePrecondIsActiveIn, final Timestamp updateDtIn, final String ruleCdIn, final String usedRuleCdIn, final RuleVO ruleVOIn)
107 {
108 this.rulePrecondId = rulePrecondIdIn;
109 this.rulePrecondLb = rulePrecondLbIn;
110 this.rulePrecondIsBidir = rulePrecondIsBidirIn;
111 this.rulePrecondIsActive = rulePrecondIsActiveIn;
112 this.updateDt = updateDtIn;
113 this.ruleCd = ruleCdIn;
114 this.usedRuleCd = usedRuleCdIn;
115 this.ruleVO = ruleVOIn;
116 }
117
118
119
120
121
122
123
124 public RulePreconditionVO(final RulePreconditionVO otherBean)
125 {
126 this.rulePrecondId = otherBean.getRulePrecondId();
127 this.rulePrecondLb = otherBean.getRulePrecondLb();
128 this.rulePrecondIsBidir = otherBean.getRulePrecondIsBidir();
129 this.rulePrecondIsActive = otherBean.getRulePrecondIsActive();
130 this.updateDt = otherBean.getUpdateDt();
131 this.ruleCd = otherBean.getRuleCd();
132 this.usedRuleCd = otherBean.getUsedRuleCd();
133 this.ruleVO = otherBean.getRuleVO();
134 }
135
136
137
138
139
140 public void copy(final RulePreconditionVO otherBean)
141 {
142 if (null != otherBean)
143 {
144 this.setRulePrecondId(otherBean.getRulePrecondId());
145 this.setRulePrecondLb(otherBean.getRulePrecondLb());
146 this.setRulePrecondIsBidir(otherBean.getRulePrecondIsBidir());
147 this.setRulePrecondIsActive(otherBean.getRulePrecondIsActive());
148 this.setUpdateDt(otherBean.getUpdateDt());
149 this.setRuleCd(otherBean.getRuleCd());
150 this.setUsedRuleCd(otherBean.getUsedRuleCd());
151 this.setRuleVO(otherBean.getRuleVO());
152 }
153 }
154
155
156
157
158
159
160 public Integer getRulePrecondId()
161 {
162 return this.rulePrecondId;
163 }
164
165
166
167
168
169 public void setRulePrecondId(final Integer value)
170 {
171 this.rulePrecondId = value;
172 }
173
174
175
176
177
178
179 public String getRulePrecondLb()
180 {
181 return this.rulePrecondLb;
182 }
183
184
185
186
187
188 public void setRulePrecondLb(final String value)
189 {
190 this.rulePrecondLb = value;
191 }
192
193
194
195
196
197
198 public String getRulePrecondIsBidir()
199 {
200 return this.rulePrecondIsBidir;
201 }
202
203
204
205
206
207 public void setRulePrecondIsBidir(final String value)
208 {
209 this.rulePrecondIsBidir = value;
210 }
211
212
213
214
215
216
217 public String getRulePrecondIsActive()
218 {
219 return this.rulePrecondIsActive;
220 }
221
222
223
224
225
226 public void setRulePrecondIsActive(final String value)
227 {
228 this.rulePrecondIsActive = value;
229 }
230
231
232
233
234
235
236 public Timestamp getUpdateDt()
237 {
238 return this.updateDt;
239 }
240
241
242
243
244
245 public void setUpdateDt(final Timestamp value)
246 {
247 this.updateDt = value;
248 }
249
250
251
252
253
254
255 public String getRuleCd()
256 {
257 return this.ruleCd;
258 }
259
260
261
262
263
264 public void setRuleCd(final String value)
265 {
266 this.ruleCd = value;
267 }
268
269
270
271
272
273
274 public String getUsedRuleCd()
275 {
276 return this.usedRuleCd;
277 }
278
279
280
281
282
283 public void setUsedRuleCd(final String value)
284 {
285 this.usedRuleCd = value;
286 }
287
288
289
290
291
292
293 public RuleVO getRuleVO()
294 {
295 return this.ruleVO;
296 }
297
298
299
300
301
302 public void setRuleVO(RuleVO value)
303 {
304 this.ruleVO = value;
305 }
306
307
308
309
310
311
312 @Override
313 public boolean equals(final Object object)
314 {
315 if (object==null || object.getClass() != this.getClass())
316 {
317 return false;
318 }
319
320 if (object==this)
321 {
322 return true;
323 }
324 RulePreconditionVO rhs = (RulePreconditionVO) object;
325 return new EqualsBuilder()
326 .append(this.getRulePrecondId(), rhs.getRulePrecondId())
327 .append(this.getRulePrecondLb(), rhs.getRulePrecondLb())
328 .append(this.getRulePrecondIsBidir(), rhs.getRulePrecondIsBidir())
329 .append(this.getRulePrecondIsActive(), rhs.getRulePrecondIsActive())
330 .append(this.getUpdateDt(), rhs.getUpdateDt())
331 .append(this.getRuleCd(), rhs.getRuleCd())
332 .append(this.getUsedRuleCd(), rhs.getUsedRuleCd())
333 .append(this.getRuleVO(), rhs.getRuleVO())
334 .isEquals();
335 }
336
337
338
339
340
341
342 public int compareTo(final RulePreconditionVO object)
343 {
344 if (object==null)
345 {
346 return -1;
347 }
348
349 if (object==this)
350 {
351 return 0;
352 }
353 return new CompareToBuilder()
354 .append(this.getRulePrecondId(), object.getRulePrecondId())
355 .append(this.getRulePrecondLb(), object.getRulePrecondLb())
356 .append(this.getRulePrecondIsBidir(), object.getRulePrecondIsBidir())
357 .append(this.getRulePrecondIsActive(), object.getRulePrecondIsActive())
358 .append(this.getUpdateDt(), object.getUpdateDt())
359 .append(this.getRuleCd(), object.getRuleCd())
360 .append(this.getUsedRuleCd(), object.getUsedRuleCd())
361 .append(this.getRuleVO(), object.getRuleVO())
362 .toComparison();
363 }
364
365
366
367
368
369 @Override
370 public int hashCode()
371 {
372 return new HashCodeBuilder(1249046965, -82296885)
373 .append(this.getRulePrecondId())
374 .append(this.getRulePrecondLb())
375 .append(this.getRulePrecondIsBidir())
376 .append(this.getRulePrecondIsActive())
377 .append(this.getUpdateDt())
378 .append(this.getRuleCd())
379 .append(this.getUsedRuleCd())
380
381
382 .toHashCode();
383 }
384
385
386
387
388
389 @Override
390 public String toString()
391 {
392 return new ToStringBuilder(this)
393 .append("rulePrecondId", this.getRulePrecondId())
394 .append("rulePrecondLb", this.getRulePrecondLb())
395 .append("rulePrecondIsBidir", this.getRulePrecondIsBidir())
396 .append("rulePrecondIsActive", this.getRulePrecondIsActive())
397 .append("updateDt", this.getUpdateDt())
398 .append("ruleCd", this.getRuleCd())
399 .append("usedRuleCd", this.getUsedRuleCd())
400 .append("ruleVO", this.getRuleVO())
401 .toString();
402 }
403
404
405
406
407
408
409
410
411
412
413
414
415
416 protected static boolean equal(final Object first, final Object second)
417 {
418 final boolean equal;
419
420 if (first == null)
421 {
422 equal = (second == null);
423 }
424 else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
425 {
426 equal = Arrays.equals((Object[])first, (Object[])second);
427 }
428 else
429 {
430 equal = first.equals(second);
431 }
432
433 return equal;
434 }
435
436
437 }