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