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