001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
005//
006package fr.ifremer.adagio.core.dao.referential.pmfm;
007
008/*
009 * #%L
010 * SIH-Adagio :: Core
011 * $Id:$
012 * $HeadURL:$
013 * %%
014 * Copyright (C) 2012 - 2014 Ifremer
015 * %%
016 * This program is free software: you can redistribute it and/or modify
017 * it under the terms of the GNU Affero General Public License as published by
018 * the Free Software Foundation, either version 3 of the License, or
019 * (at your option) any later version.
020 * 
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
024 * GNU General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Affero General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * #L%
029 */
030
031import fr.ifremer.adagio.core.dao.referential.Status;
032import fr.ifremer.adagio.core.dao.referential.ValidityStatus;
033import java.io.Serializable;
034
035/**
036 * Liste des valeurs qualitatives que peut prendre un paramètre.
037 * Par exemple :
038 * - pour le paramètre Sexe : "Mâle" et "Femelle"
039 * - pour le paramètre Présentation : "Vidé", "Entier", ...
040 * - pour le paramètre Catégorie : "Gros", "Moyen", ...
041 */
042// HibernateEntity.vsl annotations merge-point
043public abstract class QualitativeValue
044    implements Serializable, Comparable<QualitativeValue>
045{
046    /**
047     * The serial version UID of this class. Needed for serialization.
048     */
049    private static final long serialVersionUID = 7138352793414117324L;
050
051    // Generate 5 attributes
052    private Integer id;
053
054    /**
055     * Idenfiant interne. Généré par le système.
056     * @return this.id Integer
057     */
058    public Integer getId()
059    {
060        return this.id;
061    }
062
063    /**
064     * Idenfiant interne. Généré par le système.
065     * @param idIn Integer
066     */
067    public void setId(Integer idIn)
068    {
069        this.id = idIn;
070    }
071
072    private String label;
073
074    /**
075     * 
076     * @return this.label String
077     */
078    public String getLabel()
079    {
080        return this.label;
081    }
082
083    /**
084     * 
085     * @param labelIn String
086     */
087    public void setLabel(String labelIn)
088    {
089        this.label = labelIn;
090    }
091
092    private String name;
093
094    /**
095     * 
096     * @return this.name String
097     */
098    public String getName()
099    {
100        return this.name;
101    }
102
103    /**
104     * 
105     * @param nameIn String
106     */
107    public void setName(String nameIn)
108    {
109        this.name = nameIn;
110    }
111
112    private String description;
113
114    /**
115     * 
116     * @return this.description String
117     */
118    public String getDescription()
119    {
120        return this.description;
121    }
122
123    /**
124     * 
125     * @param descriptionIn String
126     */
127    public void setDescription(String descriptionIn)
128    {
129        this.description = descriptionIn;
130    }
131
132    private String comments;
133
134    /**
135     * 
136     * @return this.comments String
137     */
138    public String getComments()
139    {
140        return this.comments;
141    }
142
143    /**
144     * 
145     * @param commentsIn String
146     */
147    public void setComments(String commentsIn)
148    {
149        this.comments = commentsIn;
150    }
151
152    // Generate 25 associations
153    private ValidityStatus validityStatus;
154
155    /**
156     * Etat de validation d'une donnée du référentiel. Utile pour les responsables de référentiel.
157     * Validity status of a referential data.
158     * @return this.validityStatus ValidityStatus
159     */
160    public ValidityStatus getValidityStatus()
161    {
162        return this.validityStatus;
163    }
164
165    /**
166     * Etat de validation d'une donnée du référentiel. Utile pour les responsables de référentiel.
167     * Validity status of a referential data.
168     * @param validityStatusIn ValidityStatus
169     */
170    public void setValidityStatus(ValidityStatus validityStatusIn)
171    {
172        this.validityStatus = validityStatusIn;
173    }
174
175    private Status status;
176
177    /**
178     * Pour les données du référentiel, information permettant de déterminer si une donnée est
179     * valide,
180     * obsolète ou temporaire.
181     * - obsolète (=inactif) : '0'
182     * - valide (=actif) : '1'
183     * - temporaire : '2'
184     * - en cours de suppression : '3'
185     * -  : '4'
186     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
187     * confondre
188     * avec par exemple l'activité d'un navire sur un mois.
189     * @return this.status Status
190     */
191    public Status getStatus()
192    {
193        return this.status;
194    }
195
196    /**
197     * Pour les données du référentiel, information permettant de déterminer si une donnée est
198     * valide,
199     * obsolète ou temporaire.
200     * - obsolète (=inactif) : '0'
201     * - valide (=actif) : '1'
202     * - temporaire : '2'
203     * - en cours de suppression : '3'
204     * -  : '4'
205     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
206     * confondre
207     * avec par exemple l'activité d'un navire sur un mois.
208     * @param statusIn Status
209     */
210    public void setStatus(Status statusIn)
211    {
212        this.status = statusIn;
213    }
214
215    private Parameter parameter;
216
217    /**
218     * Un paramètre est une propriété du milieu ou d'un élément du milieu qui contribue à en
219     * apprécier les
220     * caractéristiques et/ou la qualité et/ou l'aptitude à des usages.
221     * Le paramètre se décline en trois types : quantitatif, qualitatif ou libre.
222     * Le type quantitatif se rapporte aux paramètres qui ont une infinité de résultats numériques.
223     * Le type qualitatif se rapporte aux paramètres qui ne prennent qu'un nombre limité de valeurs
224     * prédéfinies pour chacun d'eux.
225     * Le type libre, ou alphanumérique, correspond aux paramètres de valeurs alphanumériques, sans
226     * limite
227     * de valeurs possibles (hormis la longueur de la chaine : 40 max).
228     * Ces trois types sont mutuellement exclusifs.
229     * Exemple de paramètre :
230     * • Taille (numérique)
231     * • Age (numérique)
232     * • Sexe (qualitatif)
233     * • Catégorie commerciale (qualitatif)
234     * • Présentation commerciale (qualitatif)
235     * • Vrac / Hors Vrac (qualitatif)
236     * • Rejet / Débarquement (qualitatif) (Discard/Landing)
237     * • Stade de maturité (qualitatif) (Maturity stage)
238     * • Numéro de contrat (libre - alphanumérique)
239     * Cette liste n’est pas exhaustive.
240     * Nombre de lignes : 130
241     * @return this.parameter Parameter
242     */
243    public Parameter getParameter()
244    {
245        return this.parameter;
246    }
247
248    /**
249     * Un paramètre est une propriété du milieu ou d'un élément du milieu qui contribue à en
250     * apprécier les
251     * caractéristiques et/ou la qualité et/ou l'aptitude à des usages.
252     * Le paramètre se décline en trois types : quantitatif, qualitatif ou libre.
253     * Le type quantitatif se rapporte aux paramètres qui ont une infinité de résultats numériques.
254     * Le type qualitatif se rapporte aux paramètres qui ne prennent qu'un nombre limité de valeurs
255     * prédéfinies pour chacun d'eux.
256     * Le type libre, ou alphanumérique, correspond aux paramètres de valeurs alphanumériques, sans
257     * limite
258     * de valeurs possibles (hormis la longueur de la chaine : 40 max).
259     * Ces trois types sont mutuellement exclusifs.
260     * Exemple de paramètre :
261     * • Taille (numérique)
262     * • Age (numérique)
263     * • Sexe (qualitatif)
264     * • Catégorie commerciale (qualitatif)
265     * • Présentation commerciale (qualitatif)
266     * • Vrac / Hors Vrac (qualitatif)
267     * • Rejet / Débarquement (qualitatif) (Discard/Landing)
268     * • Stade de maturité (qualitatif) (Maturity stage)
269     * • Numéro de contrat (libre - alphanumérique)
270     * Cette liste n’est pas exhaustive.
271     * Nombre de lignes : 130
272     * @param parameterIn Parameter
273     */
274    public void setParameter(Parameter parameterIn)
275    {
276        this.parameter = parameterIn;
277    }
278
279    /**
280     * Returns <code>true</code> if the argument is an QualitativeValue instance and all identifiers for this entity
281     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
282     */
283    @Override
284    public boolean equals(Object object)
285    {
286        if (this == object)
287        {
288            return true;
289        }
290        if (!(object instanceof QualitativeValue))
291        {
292            return false;
293        }
294        final QualitativeValue that = (QualitativeValue)object;
295        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
296        {
297            return false;
298        }
299        return true;
300    }
301
302    /**
303     * Returns a hash code based on this entity's identifiers.
304     */
305    @Override
306    public int hashCode()
307    {
308        int hashCode = 0;
309        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
310
311        return hashCode;
312    }
313
314    /**
315     * Constructs new instances of {@link QualitativeValue}.
316     */
317    public static final class Factory
318    {
319        /**
320         * Constructs a new instance of {@link QualitativeValue}.
321         * @return new QualitativeValueImpl()
322         */
323        public static QualitativeValue newInstance()
324        {
325            return new QualitativeValueImpl();
326        }
327
328        /**
329         * Constructs a new instance of {@link QualitativeValue}, taking all required and/or
330         * read-only properties as arguments, except for identifiers.
331         * @param name String
332         * @param validityStatus ValidityStatus
333         * @param status Status
334         * @param parameter Parameter
335         * @return newInstance
336         */
337        public static QualitativeValue newInstance(String name, ValidityStatus validityStatus, Status status, Parameter parameter)
338        {
339            final QualitativeValue entity = new QualitativeValueImpl();
340            entity.setName(name);
341            entity.setValidityStatus(validityStatus);
342            entity.setStatus(status);
343            entity.setParameter(parameter);
344            return entity;
345        }
346
347        /**
348         * Constructs a new instance of {@link QualitativeValue}, taking all possible properties
349         * (except the identifier(s))as arguments.
350         * @param label String
351         * @param name String
352         * @param description String
353         * @param comments String
354         * @param validityStatus ValidityStatus
355         * @param status Status
356         * @param parameter Parameter
357         * @return newInstance QualitativeValue
358         */
359        public static QualitativeValue newInstance(String label, String name, String description, String comments, ValidityStatus validityStatus, Status status, Parameter parameter)
360        {
361            final QualitativeValue entity = new QualitativeValueImpl();
362            entity.setLabel(label);
363            entity.setName(name);
364            entity.setDescription(description);
365            entity.setComments(comments);
366            entity.setValidityStatus(validityStatus);
367            entity.setStatus(status);
368            entity.setParameter(parameter);
369            return entity;
370        }
371    }
372
373    /**
374     * @see Comparable#compareTo
375     */
376    public int compareTo(QualitativeValue o)
377    {
378        int cmp = 0;
379        if (this.getId() != null)
380        {
381            cmp = this.getId().compareTo(o.getId());
382        }
383        else
384        {
385            if (this.getLabel() != null)
386            {
387                cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel()));
388            }
389            if (this.getName() != null)
390            {
391                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
392            }
393            if (this.getDescription() != null)
394            {
395                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
396            }
397            if (this.getComments() != null)
398            {
399                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
400            }
401        }
402        return cmp;
403    }
404// HibernateEntity.vsl merge-point
405// QualitativeValue.java merge-point
406}