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::administration::program::MonLocProgVO
27   * STEREOTYPE:   ValueObject
28   */
29  package fr.ifremer.quadrige3.core.vo.administration.program;
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   * Liste des lieux surveillés par un programme.
41   */
42  public class MonLocProgVO
43      implements Serializable, Comparable<MonLocProgVO>
44  {
45      /** The serial version UID of this class. Needed for serialization. */
46      private static final long serialVersionUID = 1050593859182152129L;
47  
48      // Class attributes
49      /** TODO: Model Documentation for attribute monLocProgId */
50      protected Integer monLocProgId;
51      /**
52       * Date de modification de l'objet, mise à jour par le système
53       */
54      protected Timestamp updateDt;
55      /**
56       * Identifiant interne du lieu de surveillance
57       */
58      protected Integer monLocId;
59      /** TODO: Model Documentation for attribute progCd */
60      protected String progCd;
61  
62      // Class associationEnds
63      /**
64       * Activités à l'origine de la collecte d'un ensemble cohérent de données.
65       */
66      protected ProgramVO programVO;
67  
68      /** Default Constructor with no properties */
69      public MonLocProgVO()
70      {
71          // Documented empty block - avoid compiler warning - no super constructor
72      }
73  
74      /**
75       * Constructor taking only required properties
76       * @param monLocProgIdIn Integer
77       * @param monLocIdIn Integer Identifiant interne du lieu de surveillance
78       * @param progCdIn String
79       * @param programVOIn ProgramVO Activités à l'origine de la collecte d'un ensemble cohérent de données.
80       */
81      public MonLocProgVO(final Integer monLocProgIdIn, final Integer monLocIdIn, final String progCdIn, final ProgramVO programVOIn)
82      {
83          this.monLocProgId = monLocProgIdIn;
84          this.monLocId = monLocIdIn;
85          this.progCd = progCdIn;
86          this.programVO = programVOIn;
87      }
88  
89      /**
90       * Constructor with all properties
91       * @param monLocProgIdIn Integer
92       * @param updateDtIn Timestamp
93       * @param monLocIdIn Integer
94       * @param progCdIn String
95       * @param programVOIn ProgramVO
96       */
97      public MonLocProgVO(final Integer monLocProgIdIn, final Timestamp updateDtIn, final Integer monLocIdIn, final String progCdIn, final ProgramVO programVOIn)
98      {
99          this.monLocProgId = monLocProgIdIn;
100         this.updateDt = updateDtIn;
101         this.monLocId = monLocIdIn;
102         this.progCd = progCdIn;
103         this.programVO = programVOIn;
104     }
105 
106     /**
107      * Copies constructor from other MonLocProgVO
108      *
109      * @param otherBean Cannot be <code>null</code>
110      * @throws NullPointerException if the argument is <code>null</code>
111      */
112     public MonLocProgVO(final MonLocProgVO otherBean)
113     {
114         this.monLocProgId = otherBean.getMonLocProgId();
115         this.updateDt = otherBean.getUpdateDt();
116         this.monLocId = otherBean.getMonLocId();
117         this.progCd = otherBean.getProgCd();
118         this.programVO = otherBean.getProgramVO();
119     }
120 
121     /**
122      * Copies all properties from the argument value object into this value object.
123      * @param otherBean Cannot be <code>null</code>
124      */
125     public void copy(final MonLocProgVO otherBean)
126     {
127         if (null != otherBean)
128         {
129             this.setMonLocProgId(otherBean.getMonLocProgId());
130             this.setUpdateDt(otherBean.getUpdateDt());
131             this.setMonLocId(otherBean.getMonLocId());
132             this.setProgCd(otherBean.getProgCd());
133             this.setProgramVO(otherBean.getProgramVO());
134         }
135     }
136 
137     /**
138      * TODO: Model Documentation for attribute monLocProgId
139      * Get the monLocProgId Attribute
140      * @return monLocProgId Integer
141      */
142     public Integer getMonLocProgId()
143     {
144         return this.monLocProgId;
145     }
146 
147     /**
148      * 
149      * @param value Integer
150      */
151     public void setMonLocProgId(final Integer value)
152     {
153         this.monLocProgId = value;
154     }
155 
156     /**
157      * Date de modification de l'objet, mise à jour par le système
158      * Get the updateDt Attribute
159      * @return updateDt Timestamp
160      */
161     public Timestamp getUpdateDt()
162     {
163         return this.updateDt;
164     }
165 
166     /**
167      * Date de modification de l'objet, mise à jour par le système
168      * @param value Timestamp
169      */
170     public void setUpdateDt(final Timestamp value)
171     {
172         this.updateDt = value;
173     }
174 
175     /**
176      * Identifiant interne du lieu de surveillance
177      * Get the monLocId Attribute
178      * @return monLocId Integer
179      */
180     public Integer getMonLocId()
181     {
182         return this.monLocId;
183     }
184 
185     /**
186      * Identifiant interne du lieu de surveillance
187      * @param value Integer
188      */
189     public void setMonLocId(final Integer value)
190     {
191         this.monLocId = value;
192     }
193 
194     /**
195      * TODO: Model Documentation for attribute progCd
196      * Get the progCd Attribute
197      * @return progCd String
198      */
199     public String getProgCd()
200     {
201         return this.progCd;
202     }
203 
204     /**
205      * 
206      * @param value String
207      */
208     public void setProgCd(final String value)
209     {
210         this.progCd = value;
211     }
212 
213     /**
214      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
215      * Get the programVO Association
216      * @return this.programVO ProgramVO
217      */
218     public ProgramVO getProgramVO()
219     {
220         return this.programVO;
221     }
222 
223     /**
224      * Sets the programVO
225      * @param value ProgramVO
226      */
227     public void setProgramVO(ProgramVO value)
228     {
229         this.programVO = value;
230     }
231 
232     /**
233      * @param object to compare this object against
234      * @return boolean if equal
235      * @see Object#equals(Object)
236      */
237     @Override
238     public boolean equals(final Object object)
239     {
240         if (object==null || object.getClass() != this.getClass())
241         {
242              return false;
243         }
244         // Check if the same object instance
245         if (object==this)
246         {
247             return true;
248         }
249         MonLocProgVO rhs = (MonLocProgVO) object;
250         return new EqualsBuilder()
251             .append(this.getMonLocProgId(), rhs.getMonLocProgId())
252             .append(this.getUpdateDt(), rhs.getUpdateDt())
253             .append(this.getMonLocId(), rhs.getMonLocId())
254             .append(this.getProgCd(), rhs.getProgCd())
255             .append(this.getProgramVO(), rhs.getProgramVO())
256             .isEquals();
257     }
258 
259     /**
260      * @param object to compare this object against
261      * @return int if equal
262      * @see Comparable#compareTo(Object)
263      */
264     public int compareTo(final MonLocProgVO object)
265     {
266         if (object==null)
267         {
268             return -1;
269         }
270         // Check if the same object instance
271         if (object==this)
272         {
273             return 0;
274         }
275         return new CompareToBuilder()
276             .append(this.getMonLocProgId(), object.getMonLocProgId())
277             .append(this.getUpdateDt(), object.getUpdateDt())
278             .append(this.getMonLocId(), object.getMonLocId())
279             .append(this.getProgCd(), object.getProgCd())
280             .append(this.getProgramVO(), object.getProgramVO())
281             .toComparison();
282     }
283 
284     /**
285      * @return int hashCode value
286      * @see Object#hashCode()
287      */
288     @Override
289     public int hashCode()
290     {
291         return new HashCodeBuilder(1249046965, -82296885)
292             .append(this.getMonLocProgId())
293             .append(this.getUpdateDt())
294             .append(this.getMonLocId())
295             .append(this.getProgCd())
296             .append(this.getProgramVO())
297             .toHashCode();
298     }
299 
300     /**
301      * @return String representation of object
302      * @see Object#toString()
303      */
304     @Override
305     public String toString()
306     {
307         return new ToStringBuilder(this)
308             .append("monLocProgId", this.getMonLocProgId())
309             .append("updateDt", this.getUpdateDt())
310             .append("monLocId", this.getMonLocId())
311             .append("progCd", this.getProgCd())
312             .append("programVO", this.getProgramVO())
313             .toString();
314     }
315 
316     /**
317      * This is a convenient helper method which is able to detect whether or not two values are equal. Two values
318      * are equal when they are both {@code null}, are arrays of the same length with equal elements or are
319      * equal objects (this includes {@link java.util.Collection} and {@link java.util.Map} instances).
320      *
321      * <p/>Note that for array, collection or map instances the comparison runs one level deep.
322      *
323      * @param first the first object to compare, may be {@code null}
324      * @param second the second object to compare, may be {@code null}
325      * @return this method will return {@code true} in case both objects are equal as explained above;
326      *      in all other cases this method will return {@code false}
327      */
328     protected static boolean equal(final Object first, final Object second)
329     {
330         final boolean equal;
331 
332         if (first == null)
333         {
334             equal = (second == null);
335         }
336         else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
337         {
338             equal = Arrays.equals((Object[])first, (Object[])second);
339         }
340         else // note that the following also covers java.util.Collection and java.util.Map
341         {
342             equal = first.equals(second);
343         }
344 
345         return equal;
346     }
347 
348     // MonLocProgVO value-object java merge-point
349 }