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