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::data::survey::CampaignVO
27   * STEREOTYPE:   ValueObject
28   */
29  package fr.ifremer.quadrige3.core.vo.data.survey;
30  
31  import java.io.Serializable;
32  import java.sql.Timestamp;
33  import java.util.Arrays;
34  import java.util.Date;
35  import org.apache.commons.lang3.builder.CompareToBuilder;
36  import org.apache.commons.lang3.builder.EqualsBuilder;
37  import org.apache.commons.lang3.builder.HashCodeBuilder;
38  import org.apache.commons.lang3.builder.ToStringBuilder;
39  
40  /**
41   * TODO: Model Documentation for class CampaignVO
42   */
43  public class CampaignVO
44      implements Serializable, Comparable<CampaignVO>
45  {
46      /** The serial version UID of this class. Needed for serialization. */
47      private static final long serialVersionUID = 3930695978259017781L;
48  
49      // Class attributes
50      /** TODO: Model Documentation for attribute campaignId */
51      protected Integer campaignId;
52      /** TODO: Model Documentation for attribute campaignNm */
53      protected String campaignNm;
54      /** TODO: Model Documentation for attribute campaignStartDt */
55      protected Date campaignStartDt;
56      /** TODO: Model Documentation for attribute campaignEndDt */
57      protected Date campaignEndDt;
58      /** TODO: Model Documentation for attribute campaignSismerLk */
59      protected String campaignSismerLk;
60      /** TODO: Model Documentation for attribute campaignCm */
61      protected String campaignCm;
62      /** TODO: Model Documentation for attribute campaignPositionCm */
63      protected String campaignPositionCm;
64      /** TODO: Model Documentation for attribute quserId */
65      protected Integer quserId;
66      /** TODO: Model Documentation for attribute recDepId */
67      protected Integer recDepId;
68      /** TODO: Model Documentation for attribute updateDt */
69      protected Timestamp updateDt;
70  
71      // Class associationEnds
72      /** TODO: Model Documentation for attribute occasionVOs */
73      protected OccasionVO[] occasionVOs;
74  
75      /** Default Constructor with no properties */
76      public CampaignVO()
77      {
78          // Documented empty block - avoid compiler warning - no super constructor
79      }
80  
81      /**
82       * Constructor taking only required properties
83       * @param campaignIdIn Integer
84       * @param campaignNmIn String
85       * @param campaignStartDtIn Date
86       * @param quserIdIn Integer
87       * @param recDepIdIn Integer
88       */
89      public CampaignVO(final Integer campaignIdIn, final String campaignNmIn, final Date campaignStartDtIn, final Integer quserIdIn, final Integer recDepIdIn)
90      {
91          this.campaignId = campaignIdIn;
92          this.campaignNm = campaignNmIn;
93          this.campaignStartDt = campaignStartDtIn;
94          this.quserId = quserIdIn;
95          this.recDepId = recDepIdIn;
96      }
97  
98      /**
99       * Constructor with all properties
100      * @param campaignIdIn Integer
101      * @param campaignNmIn String
102      * @param campaignStartDtIn Date
103      * @param campaignEndDtIn Date
104      * @param campaignSismerLkIn String
105      * @param campaignCmIn String
106      * @param campaignPositionCmIn String
107      * @param quserIdIn Integer
108      * @param recDepIdIn Integer
109      * @param updateDtIn Timestamp
110      * @param occasionVOsIn OccasionVO[]
111      */
112     public CampaignVO(final Integer campaignIdIn, final String campaignNmIn, final Date campaignStartDtIn, final Date campaignEndDtIn, final String campaignSismerLkIn, final String campaignCmIn, final String campaignPositionCmIn, final Integer quserIdIn, final Integer recDepIdIn, final Timestamp updateDtIn, final OccasionVO[] occasionVOsIn)
113     {
114         this.campaignId = campaignIdIn;
115         this.campaignNm = campaignNmIn;
116         this.campaignStartDt = campaignStartDtIn;
117         this.campaignEndDt = campaignEndDtIn;
118         this.campaignSismerLk = campaignSismerLkIn;
119         this.campaignCm = campaignCmIn;
120         this.campaignPositionCm = campaignPositionCmIn;
121         this.quserId = quserIdIn;
122         this.recDepId = recDepIdIn;
123         this.updateDt = updateDtIn;
124         this.occasionVOs = occasionVOsIn;
125     }
126 
127     /**
128      * Copies constructor from other CampaignVO
129      *
130      * @param otherBean Cannot be <code>null</code>
131      * @throws NullPointerException if the argument is <code>null</code>
132      */
133     public CampaignVO(final CampaignVO otherBean)
134     {
135         this.campaignId = otherBean.getCampaignId();
136         this.campaignNm = otherBean.getCampaignNm();
137         this.campaignStartDt = otherBean.getCampaignStartDt();
138         this.campaignEndDt = otherBean.getCampaignEndDt();
139         this.campaignSismerLk = otherBean.getCampaignSismerLk();
140         this.campaignCm = otherBean.getCampaignCm();
141         this.campaignPositionCm = otherBean.getCampaignPositionCm();
142         this.quserId = otherBean.getQuserId();
143         this.recDepId = otherBean.getRecDepId();
144         this.updateDt = otherBean.getUpdateDt();
145         this.occasionVOs = otherBean.getOccasionVOs();
146     }
147 
148     /**
149      * Copies all properties from the argument value object into this value object.
150      * @param otherBean Cannot be <code>null</code>
151      */
152     public void copy(final CampaignVO otherBean)
153     {
154         if (null != otherBean)
155         {
156             this.setCampaignId(otherBean.getCampaignId());
157             this.setCampaignNm(otherBean.getCampaignNm());
158             this.setCampaignStartDt(otherBean.getCampaignStartDt());
159             this.setCampaignEndDt(otherBean.getCampaignEndDt());
160             this.setCampaignSismerLk(otherBean.getCampaignSismerLk());
161             this.setCampaignCm(otherBean.getCampaignCm());
162             this.setCampaignPositionCm(otherBean.getCampaignPositionCm());
163             this.setQuserId(otherBean.getQuserId());
164             this.setRecDepId(otherBean.getRecDepId());
165             this.setUpdateDt(otherBean.getUpdateDt());
166             this.setOccasionVOs(otherBean.getOccasionVOs());
167         }
168     }
169 
170     /**
171      * TODO: Model Documentation for attribute campaignId
172      * Get the campaignId Attribute
173      * @return campaignId Integer
174      */
175     public Integer getCampaignId()
176     {
177         return this.campaignId;
178     }
179 
180     /**
181      * 
182      * @param value Integer
183      */
184     public void setCampaignId(final Integer value)
185     {
186         this.campaignId = value;
187     }
188 
189     /**
190      * TODO: Model Documentation for attribute campaignNm
191      * Get the campaignNm Attribute
192      * @return campaignNm String
193      */
194     public String getCampaignNm()
195     {
196         return this.campaignNm;
197     }
198 
199     /**
200      * 
201      * @param value String
202      */
203     public void setCampaignNm(final String value)
204     {
205         this.campaignNm = value;
206     }
207 
208     /**
209      * TODO: Model Documentation for attribute campaignStartDt
210      * Get the campaignStartDt Attribute
211      * @return campaignStartDt Date
212      */
213     public Date getCampaignStartDt()
214     {
215         return this.campaignStartDt;
216     }
217 
218     /**
219      * 
220      * @param value Date
221      */
222     public void setCampaignStartDt(final Date value)
223     {
224         this.campaignStartDt = value;
225     }
226 
227     /**
228      * TODO: Model Documentation for attribute campaignEndDt
229      * Get the campaignEndDt Attribute
230      * @return campaignEndDt Date
231      */
232     public Date getCampaignEndDt()
233     {
234         return this.campaignEndDt;
235     }
236 
237     /**
238      * 
239      * @param value Date
240      */
241     public void setCampaignEndDt(final Date value)
242     {
243         this.campaignEndDt = value;
244     }
245 
246     /**
247      * TODO: Model Documentation for attribute campaignSismerLk
248      * Get the campaignSismerLk Attribute
249      * @return campaignSismerLk String
250      */
251     public String getCampaignSismerLk()
252     {
253         return this.campaignSismerLk;
254     }
255 
256     /**
257      * 
258      * @param value String
259      */
260     public void setCampaignSismerLk(final String value)
261     {
262         this.campaignSismerLk = value;
263     }
264 
265     /**
266      * TODO: Model Documentation for attribute campaignCm
267      * Get the campaignCm Attribute
268      * @return campaignCm String
269      */
270     public String getCampaignCm()
271     {
272         return this.campaignCm;
273     }
274 
275     /**
276      * 
277      * @param value String
278      */
279     public void setCampaignCm(final String value)
280     {
281         this.campaignCm = value;
282     }
283 
284     /**
285      * TODO: Model Documentation for attribute campaignPositionCm
286      * Get the campaignPositionCm Attribute
287      * @return campaignPositionCm String
288      */
289     public String getCampaignPositionCm()
290     {
291         return this.campaignPositionCm;
292     }
293 
294     /**
295      * 
296      * @param value String
297      */
298     public void setCampaignPositionCm(final String value)
299     {
300         this.campaignPositionCm = value;
301     }
302 
303     /**
304      * TODO: Model Documentation for attribute quserId
305      * Get the quserId Attribute
306      * @return quserId Integer
307      */
308     public Integer getQuserId()
309     {
310         return this.quserId;
311     }
312 
313     /**
314      * 
315      * @param value Integer
316      */
317     public void setQuserId(final Integer value)
318     {
319         this.quserId = value;
320     }
321 
322     /**
323      * TODO: Model Documentation for attribute recDepId
324      * Get the recDepId Attribute
325      * @return recDepId Integer
326      */
327     public Integer getRecDepId()
328     {
329         return this.recDepId;
330     }
331 
332     /**
333      * 
334      * @param value Integer
335      */
336     public void setRecDepId(final Integer value)
337     {
338         this.recDepId = value;
339     }
340 
341     /**
342      * TODO: Model Documentation for attribute updateDt
343      * Get the updateDt Attribute
344      * @return updateDt Timestamp
345      */
346     public Timestamp getUpdateDt()
347     {
348         return this.updateDt;
349     }
350 
351     /**
352      * 
353      * @param value Timestamp
354      */
355     public void setUpdateDt(final Timestamp value)
356     {
357         this.updateDt = value;
358     }
359 
360     /**
361      * TODO: Model Documentation for association occasionVOs
362      * Get the occasionVOs Association
363      * This accessor method returns a reference to the live list,
364      * not a snapshot. Therefore any modification you make to the
365      * returned list will be present inside the object.
366      * @return this.occasionVOs OccasionVO[]
367      */
368     public OccasionVO[] getOccasionVOs()
369     {
370         return this.occasionVOs;
371     }
372 
373     /**
374      * Sets the occasionVOs
375      * @param value OccasionVO[]
376      */
377     public void setOccasionVOs(OccasionVO[] value)
378     {
379         this.occasionVOs = value;
380     }
381 
382     /**
383      * @param object to compare this object against
384      * @return boolean if equal
385      * @see Object#equals(Object)
386      */
387     @Override
388     public boolean equals(final Object object)
389     {
390         if (object==null || object.getClass() != this.getClass())
391         {
392              return false;
393         }
394         // Check if the same object instance
395         if (object==this)
396         {
397             return true;
398         }
399         CampaignVO rhs = (CampaignVO) object;
400         return new EqualsBuilder()
401             .append(this.getCampaignId(), rhs.getCampaignId())
402             .append(this.getCampaignNm(), rhs.getCampaignNm())
403             .append(this.getCampaignStartDt(), rhs.getCampaignStartDt())
404             .append(this.getCampaignEndDt(), rhs.getCampaignEndDt())
405             .append(this.getCampaignSismerLk(), rhs.getCampaignSismerLk())
406             .append(this.getCampaignCm(), rhs.getCampaignCm())
407             .append(this.getCampaignPositionCm(), rhs.getCampaignPositionCm())
408             .append(this.getQuserId(), rhs.getQuserId())
409             .append(this.getRecDepId(), rhs.getRecDepId())
410             .append(this.getUpdateDt(), rhs.getUpdateDt())
411             .append(this.getOccasionVOs(), rhs.getOccasionVOs())
412             .isEquals();
413     }
414 
415     /**
416      * @param object to compare this object against
417      * @return int if equal
418      * @see Comparable#compareTo(Object)
419      */
420     public int compareTo(final CampaignVO object)
421     {
422         if (object==null)
423         {
424             return -1;
425         }
426         // Check if the same object instance
427         if (object==this)
428         {
429             return 0;
430         }
431         return new CompareToBuilder()
432             .append(this.getCampaignId(), object.getCampaignId())
433             .append(this.getCampaignNm(), object.getCampaignNm())
434             .append(this.getCampaignStartDt(), object.getCampaignStartDt())
435             .append(this.getCampaignEndDt(), object.getCampaignEndDt())
436             .append(this.getCampaignSismerLk(), object.getCampaignSismerLk())
437             .append(this.getCampaignCm(), object.getCampaignCm())
438             .append(this.getCampaignPositionCm(), object.getCampaignPositionCm())
439             .append(this.getQuserId(), object.getQuserId())
440             .append(this.getRecDepId(), object.getRecDepId())
441             .append(this.getUpdateDt(), object.getUpdateDt())
442             .append(this.getOccasionVOs(), object.getOccasionVOs())
443             .toComparison();
444     }
445 
446     /**
447      * @return int hashCode value
448      * @see Object#hashCode()
449      */
450     @Override
451     public int hashCode()
452     {
453         return new HashCodeBuilder(1249046965, -82296885)
454             .append(this.getCampaignId())
455             .append(this.getCampaignNm())
456             .append(this.getCampaignStartDt())
457             .append(this.getCampaignEndDt())
458             .append(this.getCampaignSismerLk())
459             .append(this.getCampaignCm())
460             .append(this.getCampaignPositionCm())
461             .append(this.getQuserId())
462             .append(this.getRecDepId())
463             .append(this.getUpdateDt())
464             //Commented out to avoid commons-lang-2.4 recursion StackOverflowError: https://issues.apache.org/jira/browse/LANG-456
465             //.append(this.getOccasionVOs())
466             .toHashCode();
467     }
468 
469     /**
470      * @return String representation of object
471      * @see Object#toString()
472      */
473     @Override
474     public String toString()
475     {
476         return new ToStringBuilder(this)
477             .append("campaignId", this.getCampaignId())
478             .append("campaignNm", this.getCampaignNm())
479             .append("campaignStartDt", this.getCampaignStartDt())
480             .append("campaignEndDt", this.getCampaignEndDt())
481             .append("campaignSismerLk", this.getCampaignSismerLk())
482             .append("campaignCm", this.getCampaignCm())
483             .append("campaignPositionCm", this.getCampaignPositionCm())
484             .append("quserId", this.getQuserId())
485             .append("recDepId", this.getRecDepId())
486             .append("updateDt", this.getUpdateDt())
487             .append("occasionVOs", this.getOccasionVOs())
488             .toString();
489     }
490 
491     /**
492      * This is a convenient helper method which is able to detect whether or not two values are equal. Two values
493      * are equal when they are both {@code null}, are arrays of the same length with equal elements or are
494      * equal objects (this includes {@link java.util.Collection} and {@link java.util.Map} instances).
495      *
496      * <p/>Note that for array, collection or map instances the comparison runs one level deep.
497      *
498      * @param first the first object to compare, may be {@code null}
499      * @param second the second object to compare, may be {@code null}
500      * @return this method will return {@code true} in case both objects are equal as explained above;
501      *      in all other cases this method will return {@code false}
502      */
503     protected static boolean equal(final Object first, final Object second)
504     {
505         final boolean equal;
506 
507         if (first == null)
508         {
509             equal = (second == null);
510         }
511         else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
512         {
513             equal = Arrays.equals((Object[])first, (Object[])second);
514         }
515         else // note that the following also covers java.util.Collection and java.util.Map
516         {
517             equal = first.equals(second);
518         }
519 
520         return equal;
521     }
522 
523     // CampaignVO value-object java merge-point
524 }