View Javadoc
1   /*
2     * #%L
3     * Quadrige3 Core
4     * %%
5     * Copyright (C) 2017 Ifremer
6     * %%
7     * This program is free software: you can redistribute it and/or modify
8     * it under the terms of the GNU Affero General Public License as published by
9     * the Free Software Foundation, either version 3 of the License, or
10    * (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    * GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU Affero General Public License
18    * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19    * #L%
20    */
21  //
22  /**
23   * @author Generated on 07/22/2024 16:45:05+0200 Do not modify by hand!
24   *
25   * TEMPLATE:     ValueObject.vsl in andromda-java-cartridge.
26   * MODEL CLASS:  Données::fr.ifremer.quadrige3.core::vo::system::rule::RuleVO
27   * STEREOTYPE:   ValueObject
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   * TODO: Model Documentation for class RuleVO
41   */
42  public class RuleVO
43      implements Serializable, Comparable<RuleVO>
44  {
45      /** The serial version UID of this class. Needed for serialization. */
46      private static final long serialVersionUID = 9147838804589316449L;
47  
48      // Class attributes
49      /** TODO: Model Documentation for attribute ruleCd */
50      protected String ruleCd;
51      /** TODO: Model Documentation for attribute ruleControledAttribut */
52      protected String ruleControledAttribut;
53      /** TODO: Model Documentation for attribute ruleDc */
54      protected String ruleDc;
55      /** TODO: Model Documentation for attribute ruleIsActive */
56      protected String ruleIsActive;
57      /** TODO: Model Documentation for attribute ruleIsBlocking */
58      protected String ruleIsBlocking;
59      /** TODO: Model Documentation for attribute ruleErrorMsg */
60      protected String ruleErrorMsg;
61      /** TODO: Model Documentation for attribute updateDt */
62      protected Timestamp updateDt;
63      /** TODO: Model Documentation for attribute ruleListCd */
64      protected String ruleListCd;
65      /** TODO: Model Documentation for attribute functionId */
66      protected Integer functionId;
67  
68      // Class associationEnds
69      /** TODO: Model Documentation for attribute ruleGroupVO */
70      protected RuleGroupVO ruleGroupVO;
71  
72      /** TODO: Model Documentation for attribute ruleListVO */
73      protected RuleListVO ruleListVO;
74  
75      /** TODO: Model Documentation for attribute rulePmfmVOs */
76      protected RulePmfmVO[] rulePmfmVOs;
77  
78      /** TODO: Model Documentation for attribute ruleParameterVOs */
79      protected RuleParameterVO[] ruleParameterVOs;
80  
81      /** TODO: Model Documentation for attribute rulePreconditionVO */
82      protected RulePreconditionVO rulePreconditionVO;
83  
84      /** Default Constructor with no properties */
85      public RuleVO()
86      {
87          // Documented empty block - avoid compiler warning - no super constructor
88      }
89  
90      /**
91       * Constructor taking only required properties
92       * @param ruleCdIn String
93       * @param ruleControledAttributIn String
94       * @param ruleListCdIn String
95       * @param functionIdIn Integer
96       * @param ruleListVOIn RuleListVO
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      * Constructor with all properties
109      * @param ruleCdIn String
110      * @param ruleControledAttributIn String
111      * @param ruleDcIn String
112      * @param ruleIsActiveIn String
113      * @param ruleIsBlockingIn String
114      * @param ruleErrorMsgIn String
115      * @param updateDtIn Timestamp
116      * @param ruleListCdIn String
117      * @param functionIdIn Integer
118      * @param ruleGroupVOIn RuleGroupVO
119      * @param ruleListVOIn RuleListVO
120      * @param rulePmfmVOsIn RulePmfmVO[]
121      * @param ruleParameterVOsIn RuleParameterVO[]
122      * @param rulePreconditionVOIn RulePreconditionVO
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      * Copies constructor from other RuleVO
144      *
145      * @param otherBean Cannot be <code>null</code>
146      * @throws NullPointerException if the argument is <code>null</code>
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      * Copies all properties from the argument value object into this value object.
168      * @param otherBean Cannot be <code>null</code>
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      * TODO: Model Documentation for attribute ruleCd
193      * Get the ruleCd Attribute
194      * @return ruleCd String
195      */
196     public String getRuleCd()
197     {
198         return this.ruleCd;
199     }
200 
201     /**
202      * 
203      * @param value String
204      */
205     public void setRuleCd(final String value)
206     {
207         this.ruleCd = value;
208     }
209 
210     /**
211      * TODO: Model Documentation for attribute ruleControledAttribut
212      * Get the ruleControledAttribut Attribute
213      * @return ruleControledAttribut String
214      */
215     public String getRuleControledAttribut()
216     {
217         return this.ruleControledAttribut;
218     }
219 
220     /**
221      * 
222      * @param value String
223      */
224     public void setRuleControledAttribut(final String value)
225     {
226         this.ruleControledAttribut = value;
227     }
228 
229     /**
230      * TODO: Model Documentation for attribute ruleDc
231      * Get the ruleDc Attribute
232      * @return ruleDc String
233      */
234     public String getRuleDc()
235     {
236         return this.ruleDc;
237     }
238 
239     /**
240      * 
241      * @param value String
242      */
243     public void setRuleDc(final String value)
244     {
245         this.ruleDc = value;
246     }
247 
248     /**
249      * TODO: Model Documentation for attribute ruleIsActive
250      * Get the ruleIsActive Attribute
251      * @return ruleIsActive String
252      */
253     public String getRuleIsActive()
254     {
255         return this.ruleIsActive;
256     }
257 
258     /**
259      * 
260      * @param value String
261      */
262     public void setRuleIsActive(final String value)
263     {
264         this.ruleIsActive = value;
265     }
266 
267     /**
268      * TODO: Model Documentation for attribute ruleIsBlocking
269      * Get the ruleIsBlocking Attribute
270      * @return ruleIsBlocking String
271      */
272     public String getRuleIsBlocking()
273     {
274         return this.ruleIsBlocking;
275     }
276 
277     /**
278      * 
279      * @param value String
280      */
281     public void setRuleIsBlocking(final String value)
282     {
283         this.ruleIsBlocking = value;
284     }
285 
286     /**
287      * TODO: Model Documentation for attribute ruleErrorMsg
288      * Get the ruleErrorMsg Attribute
289      * @return ruleErrorMsg String
290      */
291     public String getRuleErrorMsg()
292     {
293         return this.ruleErrorMsg;
294     }
295 
296     /**
297      * 
298      * @param value String
299      */
300     public void setRuleErrorMsg(final String value)
301     {
302         this.ruleErrorMsg = value;
303     }
304 
305     /**
306      * TODO: Model Documentation for attribute updateDt
307      * Get the updateDt Attribute
308      * @return updateDt Timestamp
309      */
310     public Timestamp getUpdateDt()
311     {
312         return this.updateDt;
313     }
314 
315     /**
316      * 
317      * @param value Timestamp
318      */
319     public void setUpdateDt(final Timestamp value)
320     {
321         this.updateDt = value;
322     }
323 
324     /**
325      * TODO: Model Documentation for attribute ruleListCd
326      * Get the ruleListCd Attribute
327      * @return ruleListCd String
328      */
329     public String getRuleListCd()
330     {
331         return this.ruleListCd;
332     }
333 
334     /**
335      * 
336      * @param value String
337      */
338     public void setRuleListCd(final String value)
339     {
340         this.ruleListCd = value;
341     }
342 
343     /**
344      * TODO: Model Documentation for attribute functionId
345      * Get the functionId Attribute
346      * @return functionId Integer
347      */
348     public Integer getFunctionId()
349     {
350         return this.functionId;
351     }
352 
353     /**
354      * 
355      * @param value Integer
356      */
357     public void setFunctionId(final Integer value)
358     {
359         this.functionId = value;
360     }
361 
362     /**
363      * TODO: Model Documentation for association ruleGroupVO
364      * Get the ruleGroupVO Association
365      * @return this.ruleGroupVO RuleGroupVO
366      */
367     public RuleGroupVO getRuleGroupVO()
368     {
369         return this.ruleGroupVO;
370     }
371 
372     /**
373      * Sets the ruleGroupVO
374      * @param value RuleGroupVO
375      */
376     public void setRuleGroupVO(RuleGroupVO value)
377     {
378         this.ruleGroupVO = value;
379     }
380 
381     /**
382      * TODO: Model Documentation for association ruleListVO
383      * Get the ruleListVO Association
384      * @return this.ruleListVO RuleListVO
385      */
386     public RuleListVO getRuleListVO()
387     {
388         return this.ruleListVO;
389     }
390 
391     /**
392      * Sets the ruleListVO
393      * @param value RuleListVO
394      */
395     public void setRuleListVO(RuleListVO value)
396     {
397         this.ruleListVO = value;
398     }
399 
400     /**
401      * TODO: Model Documentation for association rulePmfmVOs
402      * Get the rulePmfmVOs Association
403      * This accessor method returns a reference to the live list,
404      * not a snapshot. Therefore any modification you make to the
405      * returned list will be present inside the object.
406      * @return this.rulePmfmVOs RulePmfmVO[]
407      */
408     public RulePmfmVO[] getRulePmfmVOs()
409     {
410         return this.rulePmfmVOs;
411     }
412 
413     /**
414      * Sets the rulePmfmVOs
415      * @param value RulePmfmVO[]
416      */
417     public void setRulePmfmVOs(RulePmfmVO[] value)
418     {
419         this.rulePmfmVOs = value;
420     }
421 
422     /**
423      * TODO: Model Documentation for association ruleParameterVOs
424      * Get the ruleParameterVOs Association
425      * This accessor method returns a reference to the live list,
426      * not a snapshot. Therefore any modification you make to the
427      * returned list will be present inside the object.
428      * @return this.ruleParameterVOs RuleParameterVO[]
429      */
430     public RuleParameterVO[] getRuleParameterVOs()
431     {
432         return this.ruleParameterVOs;
433     }
434 
435     /**
436      * Sets the ruleParameterVOs
437      * @param value RuleParameterVO[]
438      */
439     public void setRuleParameterVOs(RuleParameterVO[] value)
440     {
441         this.ruleParameterVOs = value;
442     }
443 
444     /**
445      * TODO: Model Documentation for association rulePreconditionVO
446      * Get the rulePreconditionVO Association
447      * @return this.rulePreconditionVO RulePreconditionVO
448      */
449     public RulePreconditionVO getRulePreconditionVO()
450     {
451         return this.rulePreconditionVO;
452     }
453 
454     /**
455      * Sets the rulePreconditionVO
456      * @param value RulePreconditionVO
457      */
458     public void setRulePreconditionVO(RulePreconditionVO value)
459     {
460         this.rulePreconditionVO = value;
461     }
462 
463     /**
464      * @param object to compare this object against
465      * @return boolean if equal
466      * @see Object#equals(Object)
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         // Check if the same object instance
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      * @param object to compare this object against
501      * @return int if equal
502      * @see Comparable#compareTo(Object)
503      */
504     public int compareTo(final RuleVO object)
505     {
506         if (object==null)
507         {
508             return -1;
509         }
510         // Check if the same object instance
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      * @return int hashCode value
535      * @see Object#hashCode()
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             //Commented out to avoid commons-lang-2.4 recursion StackOverflowError: https://issues.apache.org/jira/browse/LANG-456
553             //.append(this.getRulePmfmVOs())
554             //Commented out to avoid commons-lang-2.4 recursion StackOverflowError: https://issues.apache.org/jira/browse/LANG-456
555             //.append(this.getRuleParameterVOs())
556             .append(this.getRulePreconditionVO())
557             .toHashCode();
558     }
559 
560     /**
561      * @return String representation of object
562      * @see Object#toString()
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      * This is a convenient helper method which is able to detect whether or not two values are equal. Two values
587      * are equal when they are both {@code null}, are arrays of the same length with equal elements or are
588      * equal objects (this includes {@link java.util.Collection} and {@link java.util.Map} instances).
589      *
590      * <p/>Note that for array, collection or map instances the comparison runs one level deep.
591      *
592      * @param first the first object to compare, may be {@code null}
593      * @param second the second object to compare, may be {@code null}
594      * @return this method will return {@code true} in case both objects are equal as explained above;
595      *      in all other cases this method will return {@code false}
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 // note that the following also covers java.util.Collection and java.util.Map
610         {
611             equal = first.equals(second);
612         }
613 
614         return equal;
615     }
616 
617     // RuleVO value-object java merge-point
618 }