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