View Javadoc
1   /*
2     * #%L
3     * Quadrige2 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 11/16/2017 10:58:23+0100 Do not modify by hand!
24   *
25   * TEMPLATE:     ValueObject.vsl in andromda-java-cartridge.
26   * MODEL CLASS:  Données::fr.ifremer.quadrige2.core::vo::administration::strategy::PmfmStrategyVO
27   * STEREOTYPE:   ValueObject
28   */
29  package fr.ifremer.quadrige2.core.vo.administration.strategy;
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   * PSFM associés à une stratégie
41   * PMSF associés à une stratégie.
42   */
43  public class PmfmStrategyVO
44      implements Serializable, Comparable<PmfmStrategyVO>
45  {
46      /** The serial version UID of this class. Needed for serialization. */
47      private static final long serialVersionUID = -6922384140927931168L;
48  
49      // Class attributes
50      /** TODO: Model Documentation for attribute pmfmStratId */
51      protected Integer pmfmStratId;
52      /**
53       * Nombre de fois où un paramètre peut être saisi
54       * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
55       * valeur 1
56       */
57      protected Double pmfmStratParAcquisNumber;
58      /**
59       * Rang pour la presentation des résultats
60       */
61      protected Integer pmfmStratPresRk;
62      /**
63       * Indique si la saisie du paramètre se fait sur des individus
64       */
65      protected String pmfmStratParIsIndiv;
66      /** TODO: Model Documentation for attribute pmfmStratIsUniqueByTaxon */
67      protected String pmfmStratIsUniqueByTaxon;
68      /**
69       * Date de modification de l'objet, mise à jour par le système
70       */
71      protected Timestamp updateDt;
72      /** TODO: Model Documentation for attribute pmfmId */
73      protected Integer pmfmId;
74      /**
75       * Code unique de l'unité d'incertitude
76       */
77      protected Integer precTypeId;
78      /**
79       * Code du niveau de saisie
80       */
81      protected String[] acquisLevelCds;
82      /** TODO: Model Documentation for attribute uiFunctionCds */
83      protected String[] uiFunctionCds;
84      /**
85       * Identifiant interne de la stratégie
86       */
87      protected Integer stratId;
88  
89      // Class associationEnds
90      /**
91       * Définie les paramètres à mesurer dans un programme particulier.
92       */
93      protected StrategyVO strategyVO;
94  
95      /** Default Constructor with no properties */
96      public PmfmStrategyVO()
97      {
98          // Documented empty block - avoid compiler warning - no super constructor
99      }
100 
101     /**
102      * Constructor taking only required properties
103      * @param pmfmStratIdIn Integer
104      * @param pmfmStratParAcquisNumberIn Double Nombre de fois où un paramètre peut être saisi
105 Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la valeur 1
106      * @param pmfmIdIn Integer
107      * @param precTypeIdIn Integer Code unique de l'unité d'incertitude
108      * @param acquisLevelCdsIn String[] Code du niveau de saisie
109      * @param uiFunctionCdsIn String[]
110      * @param stratIdIn Integer Identifiant interne de la stratégie
111      * @param strategyVOIn StrategyVO Définie les paramètres à mesurer dans un programme particulier.
112      */
113     public PmfmStrategyVO(final Integer pmfmStratIdIn, final Double pmfmStratParAcquisNumberIn, final Integer pmfmIdIn, final Integer precTypeIdIn, final String[] acquisLevelCdsIn, final String[] uiFunctionCdsIn, final Integer stratIdIn, final StrategyVO strategyVOIn)
114     {
115         this.pmfmStratId = pmfmStratIdIn;
116         this.pmfmStratParAcquisNumber = pmfmStratParAcquisNumberIn;
117         this.pmfmId = pmfmIdIn;
118         this.precTypeId = precTypeIdIn;
119         this.acquisLevelCds = acquisLevelCdsIn;
120         this.uiFunctionCds = uiFunctionCdsIn;
121         this.stratId = stratIdIn;
122         this.strategyVO = strategyVOIn;
123     }
124 
125     /**
126      * Constructor with all properties
127      * @param pmfmStratIdIn Integer
128      * @param pmfmStratParAcquisNumberIn Double
129      * @param pmfmStratPresRkIn Integer
130      * @param pmfmStratParIsIndivIn String
131      * @param pmfmStratIsUniqueByTaxonIn String
132      * @param updateDtIn Timestamp
133      * @param pmfmIdIn Integer
134      * @param precTypeIdIn Integer
135      * @param acquisLevelCdsIn String[]
136      * @param uiFunctionCdsIn String[]
137      * @param stratIdIn Integer
138      * @param strategyVOIn StrategyVO
139      */
140     public PmfmStrategyVO(final Integer pmfmStratIdIn, final Double pmfmStratParAcquisNumberIn, final Integer pmfmStratPresRkIn, final String pmfmStratParIsIndivIn, final String pmfmStratIsUniqueByTaxonIn, final Timestamp updateDtIn, final Integer pmfmIdIn, final Integer precTypeIdIn, final String[] acquisLevelCdsIn, final String[] uiFunctionCdsIn, final Integer stratIdIn, final StrategyVO strategyVOIn)
141     {
142         this.pmfmStratId = pmfmStratIdIn;
143         this.pmfmStratParAcquisNumber = pmfmStratParAcquisNumberIn;
144         this.pmfmStratPresRk = pmfmStratPresRkIn;
145         this.pmfmStratParIsIndiv = pmfmStratParIsIndivIn;
146         this.pmfmStratIsUniqueByTaxon = pmfmStratIsUniqueByTaxonIn;
147         this.updateDt = updateDtIn;
148         this.pmfmId = pmfmIdIn;
149         this.precTypeId = precTypeIdIn;
150         this.acquisLevelCds = acquisLevelCdsIn;
151         this.uiFunctionCds = uiFunctionCdsIn;
152         this.stratId = stratIdIn;
153         this.strategyVO = strategyVOIn;
154     }
155 
156     /**
157      * Copies constructor from other PmfmStrategyVO
158      *
159      * @param otherBean Cannot be <code>null</code>
160      * @throws NullPointerException if the argument is <code>null</code>
161      */
162     public PmfmStrategyVO(final PmfmStrategyVO otherBean)
163     {
164         this.pmfmStratId = otherBean.getPmfmStratId();
165         this.pmfmStratParAcquisNumber = otherBean.getPmfmStratParAcquisNumber();
166         this.pmfmStratPresRk = otherBean.getPmfmStratPresRk();
167         this.pmfmStratParIsIndiv = otherBean.getPmfmStratParIsIndiv();
168         this.pmfmStratIsUniqueByTaxon = otherBean.getPmfmStratIsUniqueByTaxon();
169         this.updateDt = otherBean.getUpdateDt();
170         this.pmfmId = otherBean.getPmfmId();
171         this.precTypeId = otherBean.getPrecTypeId();
172         this.acquisLevelCds = otherBean.getAcquisLevelCds();
173         this.uiFunctionCds = otherBean.getUiFunctionCds();
174         this.stratId = otherBean.getStratId();
175         this.strategyVO = otherBean.getStrategyVO();
176     }
177 
178     /**
179      * Copies all properties from the argument value object into this value object.
180      * @param otherBean Cannot be <code>null</code>
181      */
182     public void copy(final PmfmStrategyVO otherBean)
183     {
184         if (null != otherBean)
185         {
186             this.setPmfmStratId(otherBean.getPmfmStratId());
187             this.setPmfmStratParAcquisNumber(otherBean.getPmfmStratParAcquisNumber());
188             this.setPmfmStratPresRk(otherBean.getPmfmStratPresRk());
189             this.setPmfmStratParIsIndiv(otherBean.getPmfmStratParIsIndiv());
190             this.setPmfmStratIsUniqueByTaxon(otherBean.getPmfmStratIsUniqueByTaxon());
191             this.setUpdateDt(otherBean.getUpdateDt());
192             this.setPmfmId(otherBean.getPmfmId());
193             this.setPrecTypeId(otherBean.getPrecTypeId());
194             this.setAcquisLevelCds(otherBean.getAcquisLevelCds());
195             this.setUiFunctionCds(otherBean.getUiFunctionCds());
196             this.setStratId(otherBean.getStratId());
197             this.setStrategyVO(otherBean.getStrategyVO());
198         }
199     }
200 
201     /**
202      * TODO: Model Documentation for attribute pmfmStratId
203      * Get the pmfmStratId Attribute
204      * @return pmfmStratId Integer
205      */
206     public Integer getPmfmStratId()
207     {
208         return this.pmfmStratId;
209     }
210 
211     /**
212      * 
213      * @param value Integer
214      */
215     public void setPmfmStratId(final Integer value)
216     {
217         this.pmfmStratId = value;
218     }
219 
220     /**
221      * Nombre de fois où un paramètre peut être saisi
222      * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
223      * valeur 1
224      * Get the pmfmStratParAcquisNumber Attribute
225      * @return pmfmStratParAcquisNumber Double
226      */
227     public Double getPmfmStratParAcquisNumber()
228     {
229         return this.pmfmStratParAcquisNumber;
230     }
231 
232     /**
233      * Nombre de fois où un paramètre peut être saisi
234      * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
235      * valeur 1
236      * @param value Double
237      */
238     public void setPmfmStratParAcquisNumber(final Double value)
239     {
240         this.pmfmStratParAcquisNumber = value;
241     }
242 
243     /**
244      * Rang pour la presentation des résultats
245      * Get the pmfmStratPresRk Attribute
246      * @return pmfmStratPresRk Integer
247      */
248     public Integer getPmfmStratPresRk()
249     {
250         return this.pmfmStratPresRk;
251     }
252 
253     /**
254      * Rang pour la presentation des résultats
255      * @param value Integer
256      */
257     public void setPmfmStratPresRk(final Integer value)
258     {
259         this.pmfmStratPresRk = value;
260     }
261 
262     /**
263      * Indique si la saisie du paramètre se fait sur des individus
264      * Get the pmfmStratParIsIndiv Attribute
265      * @return pmfmStratParIsIndiv String
266      */
267     public String getPmfmStratParIsIndiv()
268     {
269         return this.pmfmStratParIsIndiv;
270     }
271 
272     /**
273      * Indique si la saisie du paramètre se fait sur des individus
274      * @param value String
275      */
276     public void setPmfmStratParIsIndiv(final String value)
277     {
278         this.pmfmStratParIsIndiv = value;
279     }
280 
281     /**
282      * TODO: Model Documentation for attribute pmfmStratIsUniqueByTaxon
283      * Get the pmfmStratIsUniqueByTaxon Attribute
284      * @return pmfmStratIsUniqueByTaxon String
285      */
286     public String getPmfmStratIsUniqueByTaxon()
287     {
288         return this.pmfmStratIsUniqueByTaxon;
289     }
290 
291     /**
292      * 
293      * @param value String
294      */
295     public void setPmfmStratIsUniqueByTaxon(final String value)
296     {
297         this.pmfmStratIsUniqueByTaxon = value;
298     }
299 
300     /**
301      * Date de modification de l'objet, mise à jour par le système
302      * Get the updateDt Attribute
303      * @return updateDt Timestamp
304      */
305     public Timestamp getUpdateDt()
306     {
307         return this.updateDt;
308     }
309 
310     /**
311      * Date de modification de l'objet, mise à jour par le système
312      * @param value Timestamp
313      */
314     public void setUpdateDt(final Timestamp value)
315     {
316         this.updateDt = value;
317     }
318 
319     /**
320      * TODO: Model Documentation for attribute pmfmId
321      * Get the pmfmId Attribute
322      * @return pmfmId Integer
323      */
324     public Integer getPmfmId()
325     {
326         return this.pmfmId;
327     }
328 
329     /**
330      * 
331      * @param value Integer
332      */
333     public void setPmfmId(final Integer value)
334     {
335         this.pmfmId = value;
336     }
337 
338     /**
339      * Code unique de l'unité d'incertitude
340      * Get the precTypeId Attribute
341      * @return precTypeId Integer
342      */
343     public Integer getPrecTypeId()
344     {
345         return this.precTypeId;
346     }
347 
348     /**
349      * Code unique de l'unité d'incertitude
350      * @param value Integer
351      */
352     public void setPrecTypeId(final Integer value)
353     {
354         this.precTypeId = value;
355     }
356 
357     /**
358      * Code du niveau de saisie
359      * Get the acquisLevelCds Attribute
360      * @return acquisLevelCds String[]
361      */
362     public String[] getAcquisLevelCds()
363     {
364         return this.acquisLevelCds;
365     }
366 
367     /**
368      * Code du niveau de saisie
369      * @param value String[]
370      */
371     public void setAcquisLevelCds(final String[] value)
372     {
373         this.acquisLevelCds = value;
374     }
375 
376     /**
377      * TODO: Model Documentation for attribute uiFunctionCds
378      * Get the uiFunctionCds Attribute
379      * @return uiFunctionCds String[]
380      */
381     public String[] getUiFunctionCds()
382     {
383         return this.uiFunctionCds;
384     }
385 
386     /**
387      * 
388      * @param value String[]
389      */
390     public void setUiFunctionCds(final String[] value)
391     {
392         this.uiFunctionCds = value;
393     }
394 
395     /**
396      * Identifiant interne de la stratégie
397      * Get the stratId Attribute
398      * @return stratId Integer
399      */
400     public Integer getStratId()
401     {
402         return this.stratId;
403     }
404 
405     /**
406      * Identifiant interne de la stratégie
407      * @param value Integer
408      */
409     public void setStratId(final Integer value)
410     {
411         this.stratId = value;
412     }
413 
414     /**
415      * Définie les paramètres à mesurer dans un programme particulier.
416      * Get the strategyVO Association
417      * @return this.strategyVO StrategyVO
418      */
419     public StrategyVO getStrategyVO()
420     {
421         return this.strategyVO;
422     }
423 
424     /**
425      * Sets the strategyVO
426      * @param value StrategyVO
427      */
428     public void setStrategyVO(StrategyVO value)
429     {
430         this.strategyVO = value;
431     }
432 
433     /**
434      * @param object to compare this object against
435      * @return boolean if equal
436      * @see Object#equals(Object)
437      */
438     @Override
439     public boolean equals(final Object object)
440     {
441         if (object==null || object.getClass() != this.getClass())
442         {
443              return false;
444         }
445         // Check if the same object instance
446         if (object==this)
447         {
448             return true;
449         }
450         PmfmStrategyVO rhs = (PmfmStrategyVO) object;
451         return new EqualsBuilder()
452             .append(this.getPmfmStratId(), rhs.getPmfmStratId())
453             .append(this.getPmfmStratParAcquisNumber(), rhs.getPmfmStratParAcquisNumber())
454             .append(this.getPmfmStratPresRk(), rhs.getPmfmStratPresRk())
455             .append(this.getPmfmStratParIsIndiv(), rhs.getPmfmStratParIsIndiv())
456             .append(this.getPmfmStratIsUniqueByTaxon(), rhs.getPmfmStratIsUniqueByTaxon())
457             .append(this.getUpdateDt(), rhs.getUpdateDt())
458             .append(this.getPmfmId(), rhs.getPmfmId())
459             .append(this.getPrecTypeId(), rhs.getPrecTypeId())
460             .append(this.getAcquisLevelCds(), rhs.getAcquisLevelCds())
461             .append(this.getUiFunctionCds(), rhs.getUiFunctionCds())
462             .append(this.getStratId(), rhs.getStratId())
463             .append(this.getStrategyVO(), rhs.getStrategyVO())
464             .isEquals();
465     }
466 
467     /**
468      * @param object to compare this object against
469      * @return int if equal
470      * @see Comparable#compareTo(Object)
471      */
472     public int compareTo(final PmfmStrategyVO object)
473     {
474         if (object==null)
475         {
476             return -1;
477         }
478         // Check if the same object instance
479         if (object==this)
480         {
481             return 0;
482         }
483         return new CompareToBuilder()
484             .append(this.getPmfmStratId(), object.getPmfmStratId())
485             .append(this.getPmfmStratParAcquisNumber(), object.getPmfmStratParAcquisNumber())
486             .append(this.getPmfmStratPresRk(), object.getPmfmStratPresRk())
487             .append(this.getPmfmStratParIsIndiv(), object.getPmfmStratParIsIndiv())
488             .append(this.getPmfmStratIsUniqueByTaxon(), object.getPmfmStratIsUniqueByTaxon())
489             .append(this.getUpdateDt(), object.getUpdateDt())
490             .append(this.getPmfmId(), object.getPmfmId())
491             .append(this.getPrecTypeId(), object.getPrecTypeId())
492             .append(this.getAcquisLevelCds(), object.getAcquisLevelCds())
493             .append(this.getUiFunctionCds(), object.getUiFunctionCds())
494             .append(this.getStratId(), object.getStratId())
495             .append(this.getStrategyVO(), object.getStrategyVO())
496             .toComparison();
497     }
498 
499     /**
500      * @return int hashCode value
501      * @see Object#hashCode()
502      */
503     @Override
504     public int hashCode()
505     {
506         return new HashCodeBuilder(1249046965, -82296885)
507             .append(this.getPmfmStratId())
508             .append(this.getPmfmStratParAcquisNumber())
509             .append(this.getPmfmStratPresRk())
510             .append(this.getPmfmStratParIsIndiv())
511             .append(this.getPmfmStratIsUniqueByTaxon())
512             .append(this.getUpdateDt())
513             .append(this.getPmfmId())
514             .append(this.getPrecTypeId())
515             .append(this.getAcquisLevelCds())
516             .append(this.getUiFunctionCds())
517             .append(this.getStratId())
518             .append(this.getStrategyVO())
519             .toHashCode();
520     }
521 
522     /**
523      * @return String representation of object
524      * @see Object#toString()
525      */
526     @Override
527     public String toString()
528     {
529         return new ToStringBuilder(this)
530             .append("pmfmStratId", this.getPmfmStratId())
531             .append("pmfmStratParAcquisNumber", this.getPmfmStratParAcquisNumber())
532             .append("pmfmStratPresRk", this.getPmfmStratPresRk())
533             .append("pmfmStratParIsIndiv", this.getPmfmStratParIsIndiv())
534             .append("pmfmStratIsUniqueByTaxon", this.getPmfmStratIsUniqueByTaxon())
535             .append("updateDt", this.getUpdateDt())
536             .append("pmfmId", this.getPmfmId())
537             .append("precTypeId", this.getPrecTypeId())
538             .append("acquisLevelCds", this.getAcquisLevelCds())
539             .append("uiFunctionCds", this.getUiFunctionCds())
540             .append("stratId", this.getStratId())
541             .append("strategyVO", this.getStrategyVO())
542             .toString();
543     }
544 
545     /**
546      * This is a convenient helper method which is able to detect whether or not two values are equal. Two values
547      * are equal when they are both {@code null}, are arrays of the same length with equal elements or are
548      * equal objects (this includes {@link java.util.Collection} and {@link java.util.Map} instances).
549      *
550      * <p/>Note that for array, collection or map instances the comparison runs one level deep.
551      *
552      * @param first the first object to compare, may be {@code null}
553      * @param second the second object to compare, may be {@code null}
554      * @return this method will return {@code true} in case both objects are equal as explained above;
555      *      in all other cases this method will return {@code false}
556      */
557     protected static boolean equal(final Object first, final Object second)
558     {
559         final boolean equal;
560 
561         if (first == null)
562         {
563             equal = (second == null);
564         }
565         else if (first.getClass().isArray() && (second != null) && second.getClass().isArray())
566         {
567             equal = Arrays.equals((Object[])first, (Object[])second);
568         }
569         else // note that the following also covers java.util.Collection and java.util.Map
570         {
571             equal = first.equals(second);
572         }
573 
574         return equal;
575     }
576 
577     // PmfmStrategyVO value-object java merge-point
578 }