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