1 /**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7 package org.mod4j.dsl.service.mm.ServiceDsl;
8
9 import java.util.Arrays;
10 import java.util.Collections;
11 import java.util.List;
12
13 import org.eclipse.emf.common.util.Enumerator;
14
15 /**
16 * <!-- begin-user-doc -->
17 * A representation of the literals of the enumeration '<em><b>Collection Type</b></em>',
18 * and utility methods for working with them.
19 * <!-- end-user-doc -->
20 * @see org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage#getCollectionType()
21 * @model
22 * @generated
23 */
24 public enum CollectionType implements Enumerator {
25 /**
26 * The '<em><b>SINGLE</b></em>' literal object.
27 * <!-- begin-user-doc -->
28 * <!-- end-user-doc -->
29 * @see #SINGLE_VALUE
30 * @generated
31 * @ordered
32 */
33 SINGLE(0, "SINGLE", "SINGLE"),
34
35 /**
36 * The '<em><b>LIST</b></em>' literal object.
37 * <!-- begin-user-doc -->
38 * <!-- end-user-doc -->
39 * @see #LIST_VALUE
40 * @generated
41 * @ordered
42 */
43 LIST(1, "LIST", "LIST");
44
45 /**
46 * The '<em><b>SINGLE</b></em>' literal value.
47 * <!-- begin-user-doc -->
48 * <p>
49 * If the meaning of '<em><b>SINGLE</b></em>' literal object isn't clear,
50 * there really should be more of a description here...
51 * </p>
52 * <!-- end-user-doc -->
53 * @see #SINGLE
54 * @model
55 * @generated
56 * @ordered
57 */
58 public static final int SINGLE_VALUE = 0;
59
60 /**
61 * The '<em><b>LIST</b></em>' literal value.
62 * <!-- begin-user-doc -->
63 * <p>
64 * If the meaning of '<em><b>LIST</b></em>' literal object isn't clear,
65 * there really should be more of a description here...
66 * </p>
67 * <!-- end-user-doc -->
68 * @see #LIST
69 * @model
70 * @generated
71 * @ordered
72 */
73 public static final int LIST_VALUE = 1;
74
75 /**
76 * An array of all the '<em><b>Collection Type</b></em>' enumerators.
77 * <!-- begin-user-doc -->
78 * <!-- end-user-doc -->
79 * @generated
80 */
81 private static final CollectionType[] VALUES_ARRAY =
82 new CollectionType[] {
83 SINGLE,
84 LIST,
85 };
86
87 /**
88 * A public read-only list of all the '<em><b>Collection Type</b></em>' enumerators.
89 * <!-- begin-user-doc -->
90 * <!-- end-user-doc -->
91 * @generated
92 */
93 public static final List<CollectionType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
94
95 /**
96 * Returns the '<em><b>Collection Type</b></em>' literal with the specified literal value.
97 * <!-- begin-user-doc -->
98 * <!-- end-user-doc -->
99 * @generated
100 */
101 public static CollectionType get(String literal) {
102 for (int i = 0; i < VALUES_ARRAY.length; ++i) {
103 CollectionType result = VALUES_ARRAY[i];
104 if (result.toString().equals(literal)) {
105 return result;
106 }
107 }
108 return null;
109 }
110
111 /**
112 * Returns the '<em><b>Collection Type</b></em>' literal with the specified name.
113 * <!-- begin-user-doc -->
114 * <!-- end-user-doc -->
115 * @generated
116 */
117 public static CollectionType getByName(String name) {
118 for (int i = 0; i < VALUES_ARRAY.length; ++i) {
119 CollectionType result = VALUES_ARRAY[i];
120 if (result.getName().equals(name)) {
121 return result;
122 }
123 }
124 return null;
125 }
126
127 /**
128 * Returns the '<em><b>Collection Type</b></em>' literal with the specified integer value.
129 * <!-- begin-user-doc -->
130 * <!-- end-user-doc -->
131 * @generated
132 */
133 public static CollectionType get(int value) {
134 switch (value) {
135 case SINGLE_VALUE: return SINGLE;
136 case LIST_VALUE: return LIST;
137 }
138 return null;
139 }
140
141 /**
142 * <!-- begin-user-doc -->
143 * <!-- end-user-doc -->
144 * @generated
145 */
146 private final int value;
147
148 /**
149 * <!-- begin-user-doc -->
150 * <!-- end-user-doc -->
151 * @generated
152 */
153 private final String name;
154
155 /**
156 * <!-- begin-user-doc -->
157 * <!-- end-user-doc -->
158 * @generated
159 */
160 private final String literal;
161
162 /**
163 * Only this class can construct instances.
164 * <!-- begin-user-doc -->
165 * <!-- end-user-doc -->
166 * @generated
167 */
168 private CollectionType(int value, String name, String literal) {
169 this.value = value;
170 this.name = name;
171 this.literal = literal;
172 }
173
174 /**
175 * <!-- begin-user-doc -->
176 * <!-- end-user-doc -->
177 * @generated
178 */
179 public int getValue() {
180 return value;
181 }
182
183 /**
184 * <!-- begin-user-doc -->
185 * <!-- end-user-doc -->
186 * @generated
187 */
188 public String getName() {
189 return name;
190 }
191
192 /**
193 * <!-- begin-user-doc -->
194 * <!-- end-user-doc -->
195 * @generated
196 */
197 public String getLiteral() {
198 return literal;
199 }
200
201 /**
202 * Returns the literal value of the enumerator, which is its string representation.
203 * <!-- begin-user-doc -->
204 * <!-- end-user-doc -->
205 * @generated
206 */
207 @Override
208 public String toString() {
209 return literal;
210 }
211
212 } //CollectionType