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::BatchControl
027// Metafacade:   org.andromda.metafacades.uml.Enumeration
028// Stereotype:  Enumeration
029//
030package fr.ifremer.adagio.core.dao.referential;
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 BatchControl
045    implements Serializable, AdagioEnumerationDef<String>
046{
047    /** TODO: Model Documentation for Enumeration Literal SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT value "PRES,SIZE_UNLI_CAT,SEX" */
048    SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT (
049            "adagio.enumeration.BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT", 
050            n("adagio.enumeration.BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT.description"), 
051            "PRES,SIZE_UNLI_CAT,SEX"),
052    /** TODO: Model Documentation for Enumeration Literal CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT value "SIH_OBSMER|10,SIH_OBSVENTE|10" */
053    CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT (
054            "adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT", 
055            n("adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT.description"), 
056            "SIH_OBSMER|10,SIH_OBSVENTE|10"),
057    /** TODO: Model Documentation for Enumeration Literal CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN value "SIH_OBSMER|30,SIH_OBSVENTE|30" */
058    CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN (
059            "adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN", 
060            n("adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN.description"), 
061            "SIH_OBSMER|30,SIH_OBSVENTE|30"),
062    /** TODO: Model Documentation for Enumeration Literal CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT value "SIH_OBSMER|10,SIH_OBSVENTE|10" */
063    CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT (
064            "adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT", 
065            n("adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT.description"), 
066            "SIH_OBSMER|10,SIH_OBSVENTE|10"),
067    /** TODO: Model Documentation for Enumeration Literal CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX value "SIH_OBSMER|5,SIH_OBSVENTE|5" */
068    CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX (
069            "adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX", 
070            n("adagio.enumeration.BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX.description"), 
071            "SIH_OBSMER|5,SIH_OBSVENTE|5");
072
073    /**
074     * The serial version UID of this class. Needed for serialization.
075     */
076    private static final long serialVersionUID = -7540482412466321981L;
077
078    private String key;
079    private String description;
080    private String enumValue;
081
082    private BatchControl(String key, String description, String value)
083    {
084        this.key = key;
085        this.description = description;
086        this.enumValue = value;
087    }
088    
089    @Override
090    public void setValue(String newValue) {
091        if (newValue != null && !this.enumValue.equals(newValue)) {
092            // Update static lists
093            values.remove(this.enumValue);
094            literals.remove(this.enumValue);
095            this.enumValue = newValue;
096            values.put(this.enumValue, this);
097            literals.add(this.enumValue);
098        }
099    }
100    
101
102    @Override
103    public String getValueAsString()
104    {
105        return String.valueOf(this.enumValue);
106    }
107
108    /**
109     * Retrieves an instance of BatchControl from <code>its name</code>.
110     *
111     * @param name the name to create the BatchControl from.
112     * @return The enumeration literal named after the 'name' argument
113     */
114    public static BatchControl fromString(String name)
115    {
116        return BatchControl.valueOf(name);
117    }
118
119    /**
120     * Returns an enumeration literal String <code>value</code>.
121     * Required by JAXB2 enumeration implementation
122     *
123     * @return String with corresponding value
124     */
125    public String value()
126    {
127        return this.enumValue;
128    }
129
130    /**
131     * Returns an instance of BatchControl from String <code>value</code>.
132     * Required by JAXB2 enumeration implementation
133     *
134     * @param value the value to create the BatchControl from.
135     * @return static Enumeration with corresponding value
136     */
137    public static BatchControl fromValue(String value)
138    {
139        for (BatchControl enumName: BatchControl.values())
140        {
141            if (enumName.getValue().equals(value))
142            {
143                return enumName;
144            }
145        }
146        throw new IllegalArgumentException("BatchControl.fromValue(" + value + ')');
147    }
148
149    /**
150     * Gets the underlying value of this type safe enumeration.
151     * This method is necessary to comply with DaoBase implementation.
152     * @return The name of this literal.
153     */
154    public String getValue()
155    {
156        return this.enumValue;
157    }
158    
159    @Override
160    public String getDescription() {
161        return description;
162    }
163    
164    @Override
165    public String getKey() {
166        return key;
167    }
168    
169    @Override
170    public Class<?> getType() {
171        return String.class;
172    }
173    
174    /**
175     * Returns an unmodifiable list containing the literals that are known by this enumeration.
176     *
177     * @return A List containing the actual literals defined by this enumeration, this list
178     *         can not be modified.
179     */
180    public static List<String> literals()
181    {
182        return BatchControl.literals;
183    }
184
185    /**
186     * Returns an unmodifiable list containing the names of the literals that are known
187     * by this enumeration.
188     *
189     * @return A List containing the actual names of the literals defined by this
190     *         enumeration, this list can not be modified.
191     */
192    public static List<String> names()
193    {
194        return BatchControl.names;
195    }
196
197    private static Map<String, BatchControl> values = new LinkedHashMap<String, BatchControl>(5, 1);
198    private static List<String> literals = new ArrayList<String>(5);
199    private static List<String> names = new ArrayList<String>(5);
200    private static List<BatchControl> valueList = new ArrayList<BatchControl>(5);
201
202    /**
203     * Initializes the values.
204     */
205    static
206    {
207        synchronized (BatchControl.values)
208        {
209            BatchControl.values.put(SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT.enumValue, SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT);
210            BatchControl.values.put(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT.enumValue, CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT);
211            BatchControl.values.put(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN.enumValue, CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN);
212            BatchControl.values.put(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT.enumValue, CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT);
213            BatchControl.values.put(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX.enumValue, CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX);
214        }
215        synchronized (BatchControl.valueList)
216        {
217            BatchControl.valueList.add(SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT);
218            BatchControl.valueList.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT);
219            BatchControl.valueList.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN);
220            BatchControl.valueList.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT);
221            BatchControl.valueList.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX);
222            // For Adagio, lists could be reload from configuration
223            //BatchControl.valueList = Collections.unmodifiableList(valueList);
224        }
225        synchronized (BatchControl.literals)
226        {
227            BatchControl.literals.add(SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT.enumValue);
228            BatchControl.literals.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT.enumValue);
229            BatchControl.literals.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN.enumValue);
230            BatchControl.literals.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT.enumValue);
231            BatchControl.literals.add(CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX.enumValue);
232            // For Adagio, lists could be reload from configuration
233            //BatchControl.literals = Collections.unmodifiableList(literals);
234        }
235        synchronized (BatchControl.names)
236        {
237            BatchControl.names.add("SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT");
238            BatchControl.names.add("CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT");
239            BatchControl.names.add("CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN");
240            BatchControl.names.add("CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT");
241            BatchControl.names.add("CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX");
242            BatchControl.names = Collections.unmodifiableList(names);
243        }
244    }
245    // type-safe-enumeration-object java merge-point
246}