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