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::technical::configuration::ZoneCompetenceMapping
027// Metafacade:   org.andromda.metafacades.uml.Enumeration
028// Stereotype:  Enumeration
029//
030package fr.ifremer.adagio.core.dao.technical.configuration;
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 * Define working area, that an user could choose before starting Allegro data synchronization.
043 */
044public enum ZoneCompetenceMapping
045    implements Serializable, AdagioEnumerationDef<String>
046{
047    /** TODO: Model Documentation for Enumeration Literal GROUND value "Corse|394;391,Guadeloupe|430,Guyanne|423,La Réunion|433,Martinique|425,Mayotte|424;429,Méditerranée|408;410;420;415;413;419;394;391,Mer du nord manche atlantique|386;387;388;389;390;392;393;395;396;397;398;399;400;401;402;403;404;405;406;407;409;411;412;414;416;417;418;421;422;432;435;436,Saint Pierre et Miquelon|434" */
048    GROUND (
049            "adagio.enumeration.ZoneCompetenceMapping.GROUND", 
050            n("adagio.enumeration.ZoneCompetenceMapping.GROUND.description"), 
051            "Corse|394;391,Guadeloupe|430,Guyanne|423,La Réunion|433,Martinique|425,Mayotte|424;429,Méditerranée|408;410;420;415;413;419;394;391,Mer du nord manche atlantique|386;387;388;389;390;392;393;395;396;397;398;399;400;401;402;403;404;405;406;407;409;411;412;414;416;417;418;421;422;432;435;436,Saint Pierre et Miquelon|434"),
052    /** TODO: Model Documentation for Enumeration Literal SEA value "Corse|4022,Guadeloupe|4020,Guyanne|4020,La Réunion|4028,Martinique|4020,Mayotte|4028,Méditerranée|4022,Mer du nord manche atlantique|4018,Saint Pierre et Miquelon|4017" */
053    SEA (
054            "adagio.enumeration.ZoneCompetenceMapping.SEA", 
055            n("adagio.enumeration.ZoneCompetenceMapping.SEA.description"), 
056            "Corse|4022,Guadeloupe|4020,Guyanne|4020,La Réunion|4028,Martinique|4020,Mayotte|4028,Méditerranée|4022,Mer du nord manche atlantique|4018,Saint Pierre et Miquelon|4017"),
057    /** TODO: Model Documentation for Enumeration Literal DEFAULT_LOCATION_LEVEL value "Corse|142,Guadeloupe|158;159,Guyanne|154;156,La Réunion|151;152,Martinique|158;159,Mayotte|165,Méditerranée|142,Mer du nord manche atlantique|113;114,Saint Pierre et Miquelon|101" */
058    DEFAULT_LOCATION_LEVEL (
059            "adagio.enumeration.ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL", 
060            n("adagio.enumeration.ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL.description"), 
061            "Corse|142,Guadeloupe|158;159,Guyanne|154;156,La Réunion|151;152,Martinique|158;159,Mayotte|165,Méditerranée|142,Mer du nord manche atlantique|113;114,Saint Pierre et Miquelon|101");
062
063    /**
064     * The serial version UID of this class. Needed for serialization.
065     */
066    private static final long serialVersionUID = 5784511302492012787L;
067
068    private String key;
069    private String description;
070    private String enumValue;
071
072    private ZoneCompetenceMapping(String key, String description, String value)
073    {
074        this.key = key;
075        this.description = description;
076        this.enumValue = value;
077    }
078    
079    @Override
080    public void setValue(String newValue) {
081        if (newValue != null && !this.enumValue.equals(newValue)) {
082            // Update static lists
083            values.remove(this.enumValue);
084            literals.remove(this.enumValue);
085            this.enumValue = newValue;
086            values.put(this.enumValue, this);
087            literals.add(this.enumValue);
088        }
089    }
090    
091
092    @Override
093    public String getValueAsString()
094    {
095        return String.valueOf(this.enumValue);
096    }
097
098    /**
099     * Retrieves an instance of ZoneCompetenceMapping from <code>its name</code>.
100     *
101     * @param name the name to create the ZoneCompetenceMapping from.
102     * @return The enumeration literal named after the 'name' argument
103     */
104    public static ZoneCompetenceMapping fromString(String name)
105    {
106        return ZoneCompetenceMapping.valueOf(name);
107    }
108
109    /**
110     * Returns an enumeration literal String <code>value</code>.
111     * Required by JAXB2 enumeration implementation
112     *
113     * @return String with corresponding value
114     */
115    public String value()
116    {
117        return this.enumValue;
118    }
119
120    /**
121     * Returns an instance of ZoneCompetenceMapping from String <code>value</code>.
122     * Required by JAXB2 enumeration implementation
123     *
124     * @param value the value to create the ZoneCompetenceMapping from.
125     * @return static Enumeration with corresponding value
126     */
127    public static ZoneCompetenceMapping fromValue(String value)
128    {
129        for (ZoneCompetenceMapping enumName: ZoneCompetenceMapping.values())
130        {
131            if (enumName.getValue().equals(value))
132            {
133                return enumName;
134            }
135        }
136        throw new IllegalArgumentException("ZoneCompetenceMapping.fromValue(" + value + ')');
137    }
138
139    /**
140     * Gets the underlying value of this type safe enumeration.
141     * This method is necessary to comply with DaoBase implementation.
142     * @return The name of this literal.
143     */
144    public String getValue()
145    {
146        return this.enumValue;
147    }
148    
149    @Override
150    public String getDescription() {
151        return description;
152    }
153    
154    @Override
155    public String getKey() {
156        return key;
157    }
158    
159    @Override
160    public Class<?> getType() {
161        return String.class;
162    }
163    
164    /**
165     * Returns an unmodifiable list containing the literals that are known by this enumeration.
166     *
167     * @return A List containing the actual literals defined by this enumeration, this list
168     *         can not be modified.
169     */
170    public static List<String> literals()
171    {
172        return ZoneCompetenceMapping.literals;
173    }
174
175    /**
176     * Returns an unmodifiable list containing the names of the literals that are known
177     * by this enumeration.
178     *
179     * @return A List containing the actual names of the literals defined by this
180     *         enumeration, this list can not be modified.
181     */
182    public static List<String> names()
183    {
184        return ZoneCompetenceMapping.names;
185    }
186
187    private static Map<String, ZoneCompetenceMapping> values = new LinkedHashMap<String, ZoneCompetenceMapping>(3, 1);
188    private static List<String> literals = new ArrayList<String>(3);
189    private static List<String> names = new ArrayList<String>(3);
190    private static List<ZoneCompetenceMapping> valueList = new ArrayList<ZoneCompetenceMapping>(3);
191
192    /**
193     * Initializes the values.
194     */
195    static
196    {
197        synchronized (ZoneCompetenceMapping.values)
198        {
199            ZoneCompetenceMapping.values.put(GROUND.enumValue, GROUND);
200            ZoneCompetenceMapping.values.put(SEA.enumValue, SEA);
201            ZoneCompetenceMapping.values.put(DEFAULT_LOCATION_LEVEL.enumValue, DEFAULT_LOCATION_LEVEL);
202        }
203        synchronized (ZoneCompetenceMapping.valueList)
204        {
205            ZoneCompetenceMapping.valueList.add(GROUND);
206            ZoneCompetenceMapping.valueList.add(SEA);
207            ZoneCompetenceMapping.valueList.add(DEFAULT_LOCATION_LEVEL);
208            // For Adagio, lists could be reload from configuration
209            //ZoneCompetenceMapping.valueList = Collections.unmodifiableList(valueList);
210        }
211        synchronized (ZoneCompetenceMapping.literals)
212        {
213            ZoneCompetenceMapping.literals.add(GROUND.enumValue);
214            ZoneCompetenceMapping.literals.add(SEA.enumValue);
215            ZoneCompetenceMapping.literals.add(DEFAULT_LOCATION_LEVEL.enumValue);
216            // For Adagio, lists could be reload from configuration
217            //ZoneCompetenceMapping.literals = Collections.unmodifiableList(literals);
218        }
219        synchronized (ZoneCompetenceMapping.names)
220        {
221            ZoneCompetenceMapping.names.add("GROUND");
222            ZoneCompetenceMapping.names.add("SEA");
223            ZoneCompetenceMapping.names.add("DEFAULT_LOCATION_LEVEL");
224            ZoneCompetenceMapping.names = Collections.unmodifiableList(names);
225        }
226    }
227    // type-safe-enumeration-object java merge-point
228}