001/*
002 * #%L
003 * SIH-Adagio
004 * $Id: javaMergeMappings.xml 12002 2014-03-26 10:17:22Z bl05b3e $
005 * $HeadURL: https://forge.ifremer.fr/svn/sih-adagio/tags/adagio-3.5.6/mda/src/main/config/javaMergeMappings.xml $
006 * %%
007 * Copyright (C) 2012 - 2013 Ifremer
008 * %%
009 * This program is free software: you can redistribute it and/or modify
010 * it under the terms of the GNU Affero General Public License as published by
011 * the Free Software Foundation, either version 3 of the License, or
012 * (at your option) any later version.
013 * 
014 * This program is distributed in the hope that it will be useful,
015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
017 * GNU General Public License for more details.
018 * 
019 * You should have received a copy of the GNU Affero General Public License
020 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
021 * #L%
022 */
023//
024// Attention: Generated code! Do not modify by hand!
025// Generated by: TypeSafeEnumeration.vsl in andromda-java-cartridge.
026// Model Class:  Data::fr.ifremer.adagio.core.dao::referential::location::LocationLevelId
027// Metafacade:   org.andromda.metafacades.uml.Enumeration
028// Stereotype:  Enumeration
029//
030package fr.ifremer.adagio.core.dao.referential.location;
031
032import fr.ifremer.adagio.core.dao.technical.AdagioEnumerationDef;
033import java.io.Serializable;
034import java.util.ArrayList;
035import java.util.Collections;
036import java.util.LinkedHashMap;
037import java.util.List;
038import java.util.Map;
039import static org.nuiton.i18n.I18n.n;
040
041/**
042 * 
043 */
044public enum LocationLevelId
045    implements Serializable, AdagioEnumerationDef<Integer>
046{
047    /** TODO: Model Documentation for Enumeration Literal PAYS_ISO3 value 21 */
048    PAYS_ISO3 (
049            "adagio.enumeration.LocationLevelId.PAYS_ISO3", 
050            n("adagio.enumeration.LocationLevelId.PAYS_ISO3.description"), 
051            21),
052    /** TODO: Model Documentation for Enumeration Literal PORT value 6 */
053    PORT (
054            "adagio.enumeration.LocationLevelId.PORT", 
055            n("adagio.enumeration.LocationLevelId.PORT.description"), 
056            6),
057    /** TODO: Model Documentation for Enumeration Literal QUARTIER value 13 */
058    QUARTIER (
059            "adagio.enumeration.LocationLevelId.QUARTIER", 
060            n("adagio.enumeration.LocationLevelId.QUARTIER.description"), 
061            13),
062    /** TODO: Model Documentation for Enumeration Literal CRIEE value 7 */
063    CRIEE (
064            "adagio.enumeration.LocationLevelId.CRIEE", 
065            n("adagio.enumeration.LocationLevelId.CRIEE.description"), 
066            7),
067    /** TODO: Model Documentation for Enumeration Literal RECTANGLE_STATISTIQUE value 113 */
068    RECTANGLE_STATISTIQUE (
069            "adagio.enumeration.LocationLevelId.RECTANGLE_STATISTIQUE", 
070            n("adagio.enumeration.LocationLevelId.RECTANGLE_STATISTIQUE.description"), 
071            113),
072    /** TODO: Model Documentation for Enumeration Literal RECTANGLE_CGPM_GFCM value 145 */
073    RECTANGLE_CGPM_GFCM (
074            "adagio.enumeration.LocationLevelId.RECTANGLE_CGPM_GFCM", 
075            n("adagio.enumeration.LocationLevelId.RECTANGLE_CGPM_GFCM.description"), 
076            145),
077    /** TODO: Model Documentation for Enumeration Literal REGION value 31 */
078    REGION (
079            "adagio.enumeration.LocationLevelId.REGION", 
080            n("adagio.enumeration.LocationLevelId.REGION.description"), 
081            31),
082    /** TODO: Model Documentation for Enumeration Literal DEPARTEMENT value 32 */
083    DEPARTEMENT (
084            "adagio.enumeration.LocationLevelId.DEPARTEMENT", 
085            n("adagio.enumeration.LocationLevelId.DEPARTEMENT.description"), 
086            32),
087    /** TODO: Model Documentation for Enumeration Literal SOUS_RECTANGLE_STATISTIQUE value 114 */
088    SOUS_RECTANGLE_STATISTIQUE (
089            "adagio.enumeration.LocationLevelId.SOUS_RECTANGLE_STATISTIQUE", 
090            n("adagio.enumeration.LocationLevelId.SOUS_RECTANGLE_STATISTIQUE.description"), 
091            114),
092    /** TODO: Model Documentation for Enumeration Literal FAO_ZONE value 101 */
093    FAO_ZONE (
094            "adagio.enumeration.LocationLevelId.FAO_ZONE", 
095            n("adagio.enumeration.LocationLevelId.FAO_ZONE.description"), 
096            101),
097    /** TODO: Model Documentation for Enumeration Literal SCIENTIFIC_CRUISE_PROGRAM value 301 */
098    SCIENTIFIC_CRUISE_PROGRAM (
099            "adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_PROGRAM", 
100            n("adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_PROGRAM.description"), 
101            301),
102    /** TODO: Model Documentation for Enumeration Literal SCIENTIFIC_CRUISE_STRATA value 302 */
103    SCIENTIFIC_CRUISE_STRATA (
104            "adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_STRATA", 
105            n("adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_STRATA.description"), 
106            302),
107    /** TODO: Model Documentation for Enumeration Literal SCIENTIFIC_CRUISE_SUB_STRATA value 303 */
108    SCIENTIFIC_CRUISE_SUB_STRATA (
109            "adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_SUB_STRATA", 
110            n("adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_SUB_STRATA.description"), 
111            303),
112    /** TODO: Model Documentation for Enumeration Literal SCIENTIFIC_CRUISE_LOCALITE value 304 */
113    SCIENTIFIC_CRUISE_LOCALITE (
114            "adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_LOCALITE", 
115            n("adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_LOCALITE.description"), 
116            304),
117    /** TODO: Model Documentation for Enumeration Literal SCIENTIFIC_CRUISE_RADIALE value 305 */
118    SCIENTIFIC_CRUISE_RADIALE (
119            "adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_RADIALE", 
120            n("adagio.enumeration.LocationLevelId.SCIENTIFIC_CRUISE_RADIALE.description"), 
121            305);
122
123    /**
124     * The serial version UID of this class. Needed for serialization.
125     */
126    private static final long serialVersionUID = 7956808611811314402L;
127
128    private String key;
129    private String description;
130    private Integer enumValue;
131
132    private LocationLevelId(String key, String description, Integer value)
133    {
134        this.key = key;
135        this.description = description;
136        this.enumValue = value;
137    }
138    
139    @Override
140    public void setValue(Integer newValue) {
141        if (newValue != null && !this.enumValue.equals(newValue)) {
142            // Update static lists
143            values.remove(this.enumValue);
144            literals.remove(this.enumValue);
145            this.enumValue = newValue;
146            values.put(this.enumValue, this);
147            literals.add(this.enumValue);
148        }
149    }
150    
151
152    @Override
153    public String getValueAsString()
154    {
155        return String.valueOf(this.enumValue);
156    }
157
158    /**
159     * Retrieves an instance of LocationLevelId from <code>its name</code>.
160     *
161     * @param name the name to create the LocationLevelId from.
162     * @return The enumeration literal named after the 'name' argument
163     */
164    public static LocationLevelId fromString(String name)
165    {
166        return LocationLevelId.valueOf(name);
167    }
168
169    /**
170     * Returns an enumeration literal Integer <code>value</code>.
171     * Required by JAXB2 enumeration implementation
172     *
173     * @return Integer with corresponding value
174     */
175    public Integer value()
176    {
177        return this.enumValue;
178    }
179
180    /**
181     * Returns an instance of LocationLevelId from Integer <code>value</code>.
182     * Required by JAXB2 enumeration implementation
183     *
184     * @param value the value to create the LocationLevelId from.
185     * @return static Enumeration with corresponding value
186     */
187    public static LocationLevelId fromValue(Integer value)
188    {
189        for (LocationLevelId enumName: LocationLevelId.values())
190        {
191            if (enumName.getValue().equals(value))
192            {
193                return enumName;
194            }
195        }
196        throw new IllegalArgumentException("LocationLevelId.fromValue(" + value.toString() + ')');
197    }
198
199    /**
200     * Gets the underlying value of this type safe enumeration.
201     * This method is necessary to comply with DaoBase implementation.
202     * @return The name of this literal.
203     */
204    public Integer getValue()
205    {
206        return this.enumValue;
207    }
208    
209    @Override
210    public String getDescription() {
211        return description;
212    }
213    
214    @Override
215    public String getKey() {
216        return key;
217    }
218    
219    @Override
220    public Class<?> getType() {
221        return Integer.class;
222    }
223    
224    /**
225     * Returns an unmodifiable list containing the literals that are known by this enumeration.
226     *
227     * @return A List containing the actual literals defined by this enumeration, this list
228     *         can not be modified.
229     */
230    public static List<Integer> literals()
231    {
232        return LocationLevelId.literals;
233    }
234
235    /**
236     * Returns an unmodifiable list containing the names of the literals that are known
237     * by this enumeration.
238     *
239     * @return A List containing the actual names of the literals defined by this
240     *         enumeration, this list can not be modified.
241     */
242    public static List<String> names()
243    {
244        return LocationLevelId.names;
245    }
246
247    private static Map<Integer, LocationLevelId> values = new LinkedHashMap<Integer, LocationLevelId>(15, 1);
248    private static List<Integer> literals = new ArrayList<Integer>(15);
249    private static List<String> names = new ArrayList<String>(15);
250    private static List<LocationLevelId> valueList = new ArrayList<LocationLevelId>(15);
251
252    /**
253     * Initializes the values.
254     */
255    static
256    {
257        synchronized (LocationLevelId.values)
258        {
259            LocationLevelId.values.put(PAYS_ISO3.enumValue, PAYS_ISO3);
260            LocationLevelId.values.put(PORT.enumValue, PORT);
261            LocationLevelId.values.put(QUARTIER.enumValue, QUARTIER);
262            LocationLevelId.values.put(CRIEE.enumValue, CRIEE);
263            LocationLevelId.values.put(RECTANGLE_STATISTIQUE.enumValue, RECTANGLE_STATISTIQUE);
264            LocationLevelId.values.put(RECTANGLE_CGPM_GFCM.enumValue, RECTANGLE_CGPM_GFCM);
265            LocationLevelId.values.put(REGION.enumValue, REGION);
266            LocationLevelId.values.put(DEPARTEMENT.enumValue, DEPARTEMENT);
267            LocationLevelId.values.put(SOUS_RECTANGLE_STATISTIQUE.enumValue, SOUS_RECTANGLE_STATISTIQUE);
268            LocationLevelId.values.put(FAO_ZONE.enumValue, FAO_ZONE);
269            LocationLevelId.values.put(SCIENTIFIC_CRUISE_PROGRAM.enumValue, SCIENTIFIC_CRUISE_PROGRAM);
270            LocationLevelId.values.put(SCIENTIFIC_CRUISE_STRATA.enumValue, SCIENTIFIC_CRUISE_STRATA);
271            LocationLevelId.values.put(SCIENTIFIC_CRUISE_SUB_STRATA.enumValue, SCIENTIFIC_CRUISE_SUB_STRATA);
272            LocationLevelId.values.put(SCIENTIFIC_CRUISE_LOCALITE.enumValue, SCIENTIFIC_CRUISE_LOCALITE);
273            LocationLevelId.values.put(SCIENTIFIC_CRUISE_RADIALE.enumValue, SCIENTIFIC_CRUISE_RADIALE);
274        }
275        synchronized (LocationLevelId.valueList)
276        {
277            LocationLevelId.valueList.add(PAYS_ISO3);
278            LocationLevelId.valueList.add(PORT);
279            LocationLevelId.valueList.add(QUARTIER);
280            LocationLevelId.valueList.add(CRIEE);
281            LocationLevelId.valueList.add(RECTANGLE_STATISTIQUE);
282            LocationLevelId.valueList.add(RECTANGLE_CGPM_GFCM);
283            LocationLevelId.valueList.add(REGION);
284            LocationLevelId.valueList.add(DEPARTEMENT);
285            LocationLevelId.valueList.add(SOUS_RECTANGLE_STATISTIQUE);
286            LocationLevelId.valueList.add(FAO_ZONE);
287            LocationLevelId.valueList.add(SCIENTIFIC_CRUISE_PROGRAM);
288            LocationLevelId.valueList.add(SCIENTIFIC_CRUISE_STRATA);
289            LocationLevelId.valueList.add(SCIENTIFIC_CRUISE_SUB_STRATA);
290            LocationLevelId.valueList.add(SCIENTIFIC_CRUISE_LOCALITE);
291            LocationLevelId.valueList.add(SCIENTIFIC_CRUISE_RADIALE);
292            // For Adagio, lists could be reload from configuration
293            //LocationLevelId.valueList = Collections.unmodifiableList(valueList);
294        }
295        synchronized (LocationLevelId.literals)
296        {
297            LocationLevelId.literals.add(PAYS_ISO3.enumValue);
298            LocationLevelId.literals.add(PORT.enumValue);
299            LocationLevelId.literals.add(QUARTIER.enumValue);
300            LocationLevelId.literals.add(CRIEE.enumValue);
301            LocationLevelId.literals.add(RECTANGLE_STATISTIQUE.enumValue);
302            LocationLevelId.literals.add(RECTANGLE_CGPM_GFCM.enumValue);
303            LocationLevelId.literals.add(REGION.enumValue);
304            LocationLevelId.literals.add(DEPARTEMENT.enumValue);
305            LocationLevelId.literals.add(SOUS_RECTANGLE_STATISTIQUE.enumValue);
306            LocationLevelId.literals.add(FAO_ZONE.enumValue);
307            LocationLevelId.literals.add(SCIENTIFIC_CRUISE_PROGRAM.enumValue);
308            LocationLevelId.literals.add(SCIENTIFIC_CRUISE_STRATA.enumValue);
309            LocationLevelId.literals.add(SCIENTIFIC_CRUISE_SUB_STRATA.enumValue);
310            LocationLevelId.literals.add(SCIENTIFIC_CRUISE_LOCALITE.enumValue);
311            LocationLevelId.literals.add(SCIENTIFIC_CRUISE_RADIALE.enumValue);
312            // For Adagio, lists could be reload from configuration
313            //LocationLevelId.literals = Collections.unmodifiableList(literals);
314        }
315        synchronized (LocationLevelId.names)
316        {
317            LocationLevelId.names.add("PAYS_ISO3");
318            LocationLevelId.names.add("PORT");
319            LocationLevelId.names.add("QUARTIER");
320            LocationLevelId.names.add("CRIEE");
321            LocationLevelId.names.add("RECTANGLE_STATISTIQUE");
322            LocationLevelId.names.add("RECTANGLE_CGPM_GFCM");
323            LocationLevelId.names.add("REGION");
324            LocationLevelId.names.add("DEPARTEMENT");
325            LocationLevelId.names.add("SOUS_RECTANGLE_STATISTIQUE");
326            LocationLevelId.names.add("FAO_ZONE");
327            LocationLevelId.names.add("SCIENTIFIC_CRUISE_PROGRAM");
328            LocationLevelId.names.add("SCIENTIFIC_CRUISE_STRATA");
329            LocationLevelId.names.add("SCIENTIFIC_CRUISE_SUB_STRATA");
330            LocationLevelId.names.add("SCIENTIFIC_CRUISE_LOCALITE");
331            LocationLevelId.names.add("SCIENTIFIC_CRUISE_RADIALE");
332            LocationLevelId.names = Collections.unmodifiableList(names);
333        }
334    }
335    // type-safe-enumeration-object java merge-point
336}