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::transcribing::TranscribingSideId 027// Metafacade: org.andromda.metafacades.uml.Enumeration 028// Stereotype: Enumeration 029// 030package fr.ifremer.adagio.core.dao.referential.transcribing; 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 TranscribingSideId 045 implements Serializable, AdagioEnumerationDef<Integer> 046{ 047 /** TODO: Model Documentation for Enumeration Literal IN value 2 */ 048 IN ( 049 "adagio.enumeration.TranscribingSideId.IN", 050 n("adagio.enumeration.TranscribingSideId.IN.description"), 051 2), 052 /** TODO: Model Documentation for Enumeration Literal IN_OUT value 3 */ 053 IN_OUT ( 054 "adagio.enumeration.TranscribingSideId.IN_OUT", 055 n("adagio.enumeration.TranscribingSideId.IN_OUT.description"), 056 3), 057 /** TODO: Model Documentation for Enumeration Literal OUT value 1 */ 058 OUT ( 059 "adagio.enumeration.TranscribingSideId.OUT", 060 n("adagio.enumeration.TranscribingSideId.OUT.description"), 061 1); 062 063 /** 064 * The serial version UID of this class. Needed for serialization. 065 */ 066 private static final long serialVersionUID = -3482211600946580696L; 067 068 private String key; 069 private String description; 070 private Integer enumValue; 071 072 private TranscribingSideId(String key, String description, Integer value) 073 { 074 this.key = key; 075 this.description = description; 076 this.enumValue = value; 077 } 078 079 @Override 080 public void setValue(Integer 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 TranscribingSideId from <code>its name</code>. 100 * 101 * @param name the name to create the TranscribingSideId from. 102 * @return The enumeration literal named after the 'name' argument 103 */ 104 public static TranscribingSideId fromString(String name) 105 { 106 return TranscribingSideId.valueOf(name); 107 } 108 109 /** 110 * Returns an enumeration literal Integer <code>value</code>. 111 * Required by JAXB2 enumeration implementation 112 * 113 * @return Integer with corresponding value 114 */ 115 public Integer value() 116 { 117 return this.enumValue; 118 } 119 120 /** 121 * Returns an instance of TranscribingSideId from Integer <code>value</code>. 122 * Required by JAXB2 enumeration implementation 123 * 124 * @param value the value to create the TranscribingSideId from. 125 * @return static Enumeration with corresponding value 126 */ 127 public static TranscribingSideId fromValue(Integer value) 128 { 129 for (TranscribingSideId enumName: TranscribingSideId.values()) 130 { 131 if (enumName.getValue().equals(value)) 132 { 133 return enumName; 134 } 135 } 136 throw new IllegalArgumentException("TranscribingSideId.fromValue(" + value.toString() + ')'); 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 Integer 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 Integer.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<Integer> literals() 171 { 172 return TranscribingSideId.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 TranscribingSideId.names; 185 } 186 187 private static Map<Integer, TranscribingSideId> values = new LinkedHashMap<Integer, TranscribingSideId>(3, 1); 188 private static List<Integer> literals = new ArrayList<Integer>(3); 189 private static List<String> names = new ArrayList<String>(3); 190 private static List<TranscribingSideId> valueList = new ArrayList<TranscribingSideId>(3); 191 192 /** 193 * Initializes the values. 194 */ 195 static 196 { 197 synchronized (TranscribingSideId.values) 198 { 199 TranscribingSideId.values.put(IN.enumValue, IN); 200 TranscribingSideId.values.put(IN_OUT.enumValue, IN_OUT); 201 TranscribingSideId.values.put(OUT.enumValue, OUT); 202 } 203 synchronized (TranscribingSideId.valueList) 204 { 205 TranscribingSideId.valueList.add(IN); 206 TranscribingSideId.valueList.add(IN_OUT); 207 TranscribingSideId.valueList.add(OUT); 208 // For Adagio, lists could be reload from configuration 209 //TranscribingSideId.valueList = Collections.unmodifiableList(valueList); 210 } 211 synchronized (TranscribingSideId.literals) 212 { 213 TranscribingSideId.literals.add(IN.enumValue); 214 TranscribingSideId.literals.add(IN_OUT.enumValue); 215 TranscribingSideId.literals.add(OUT.enumValue); 216 // For Adagio, lists could be reload from configuration 217 //TranscribingSideId.literals = Collections.unmodifiableList(literals); 218 } 219 synchronized (TranscribingSideId.names) 220 { 221 TranscribingSideId.names.add("IN"); 222 TranscribingSideId.names.add("IN_OUT"); 223 TranscribingSideId.names.add("OUT"); 224 TranscribingSideId.names = Collections.unmodifiableList(names); 225 } 226 } 227 // type-safe-enumeration-object java merge-point 228}