1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.fzi.se.quality.qualityannotation; |
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>PCMRE Request Category</b></em>', |
18 | * and utility methods for working with them. |
19 | * <!-- end-user-doc --> |
20 | * @see de.fzi.se.quality.qualityannotation.QualityAnnotationPackage#getPCMRERequestCategory() |
21 | * @model |
22 | * @generated |
23 | */ |
24 | public enum PCMRERequestCategory implements Enumerator { |
25 | /** |
26 | * The '<em><b>Resource</b></em>' literal object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @see #RESOURCE_VALUE |
30 | * @generated |
31 | * @ordered |
32 | */ |
33 | RESOURCE(0, "Resource", "Resource"), |
34 | |
35 | /** |
36 | * The '<em><b>Infrastructure</b></em>' literal object. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #INFRASTRUCTURE_VALUE |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | INFRASTRUCTURE(1, "Infrastructure", "Infrastructure"), |
44 | |
45 | /** |
46 | * The '<em><b>Component</b></em>' literal object. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #COMPONENT_VALUE |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | COMPONENT(2, "Component", "Component"), |
54 | |
55 | /** |
56 | * The '<em><b>Resource Demand</b></em>' literal object. |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @see #RESOURCE_DEMAND_VALUE |
60 | * @generated |
61 | * @ordered |
62 | */ |
63 | RESOURCE_DEMAND(3, "ResourceDemand", "ResourceDemand"), |
64 | |
65 | /** |
66 | * The '<em><b>Component Internal</b></em>' literal object. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @see #COMPONENT_INTERNAL_VALUE |
70 | * @generated |
71 | * @ordered |
72 | */ |
73 | COMPONENT_INTERNAL(4, "ComponentInternal", "ComponentInternal"); |
74 | |
75 | /** |
76 | * The '<em><b>Resource</b></em>' literal value. |
77 | * <!-- begin-user-doc --> |
78 | * <p> |
79 | * If the meaning of '<em><b>Resource</b></em>' literal object isn't clear, |
80 | * there really should be more of a description here... |
81 | * </p> |
82 | * <!-- end-user-doc --> |
83 | * @see #RESOURCE |
84 | * @model name="Resource" |
85 | * @generated |
86 | * @ordered |
87 | */ |
88 | public static final int RESOURCE_VALUE = 0; |
89 | |
90 | /** |
91 | * The '<em><b>Infrastructure</b></em>' literal value. |
92 | * <!-- begin-user-doc --> |
93 | * <p> |
94 | * If the meaning of '<em><b>Infrastructure</b></em>' literal object isn't clear, |
95 | * there really should be more of a description here... |
96 | * </p> |
97 | * <!-- end-user-doc --> |
98 | * @see #INFRASTRUCTURE |
99 | * @model name="Infrastructure" |
100 | * @generated |
101 | * @ordered |
102 | */ |
103 | public static final int INFRASTRUCTURE_VALUE = 1; |
104 | |
105 | /** |
106 | * The '<em><b>Component</b></em>' literal value. |
107 | * <!-- begin-user-doc --> |
108 | * <p> |
109 | * If the meaning of '<em><b>Component</b></em>' literal object isn't clear, |
110 | * there really should be more of a description here... |
111 | * </p> |
112 | * <!-- end-user-doc --> |
113 | * @see #COMPONENT |
114 | * @model name="Component" |
115 | * @generated |
116 | * @ordered |
117 | */ |
118 | public static final int COMPONENT_VALUE = 2; |
119 | |
120 | /** |
121 | * The '<em><b>Resource Demand</b></em>' literal value. |
122 | * <!-- begin-user-doc --> |
123 | * <p> |
124 | * If the meaning of '<em><b>Resource Demand</b></em>' literal object isn't clear, |
125 | * there really should be more of a description here... |
126 | * </p> |
127 | * <!-- end-user-doc --> |
128 | * @see #RESOURCE_DEMAND |
129 | * @model name="ResourceDemand" |
130 | * @generated |
131 | * @ordered |
132 | */ |
133 | public static final int RESOURCE_DEMAND_VALUE = 3; |
134 | |
135 | /** |
136 | * The '<em><b>Component Internal</b></em>' literal value. |
137 | * <!-- begin-user-doc --> |
138 | * <p> |
139 | * If the meaning of '<em><b>Component Internal</b></em>' literal object isn't clear, |
140 | * there really should be more of a description here... |
141 | * </p> |
142 | * <!-- end-user-doc --> |
143 | * @see #COMPONENT_INTERNAL |
144 | * @model name="ComponentInternal" |
145 | * @generated |
146 | * @ordered |
147 | */ |
148 | public static final int COMPONENT_INTERNAL_VALUE = 4; |
149 | |
150 | /** |
151 | * An array of all the '<em><b>PCMRE Request Category</b></em>' enumerators. |
152 | * <!-- begin-user-doc --> |
153 | * <!-- end-user-doc --> |
154 | * @generated |
155 | */ |
156 | private static final PCMRERequestCategory[] VALUES_ARRAY = |
157 | new PCMRERequestCategory[] { |
158 | RESOURCE, |
159 | INFRASTRUCTURE, |
160 | COMPONENT, |
161 | RESOURCE_DEMAND, |
162 | COMPONENT_INTERNAL, |
163 | }; |
164 | |
165 | /** |
166 | * A public read-only list of all the '<em><b>PCMRE Request Category</b></em>' enumerators. |
167 | * <!-- begin-user-doc --> |
168 | * <!-- end-user-doc --> |
169 | * @generated |
170 | */ |
171 | public static final List<PCMRERequestCategory> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
172 | |
173 | /** |
174 | * Returns the '<em><b>PCMRE Request Category</b></em>' literal with the specified literal value. |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | public static PCMRERequestCategory get(String literal) { |
180 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
181 | PCMRERequestCategory result = VALUES_ARRAY[i]; |
182 | if (result.toString().equals(literal)) { |
183 | return result; |
184 | } |
185 | } |
186 | return null; |
187 | } |
188 | |
189 | /** |
190 | * Returns the '<em><b>PCMRE Request Category</b></em>' literal with the specified name. |
191 | * <!-- begin-user-doc --> |
192 | * <!-- end-user-doc --> |
193 | * @generated |
194 | */ |
195 | public static PCMRERequestCategory getByName(String name) { |
196 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
197 | PCMRERequestCategory result = VALUES_ARRAY[i]; |
198 | if (result.getName().equals(name)) { |
199 | return result; |
200 | } |
201 | } |
202 | return null; |
203 | } |
204 | |
205 | /** |
206 | * Returns the '<em><b>PCMRE Request Category</b></em>' literal with the specified integer value. |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @generated |
210 | */ |
211 | public static PCMRERequestCategory get(int value) { |
212 | switch (value) { |
213 | case RESOURCE_VALUE: return RESOURCE; |
214 | case INFRASTRUCTURE_VALUE: return INFRASTRUCTURE; |
215 | case COMPONENT_VALUE: return COMPONENT; |
216 | case RESOURCE_DEMAND_VALUE: return RESOURCE_DEMAND; |
217 | case COMPONENT_INTERNAL_VALUE: return COMPONENT_INTERNAL; |
218 | } |
219 | return null; |
220 | } |
221 | |
222 | /** |
223 | * <!-- begin-user-doc --> |
224 | * <!-- end-user-doc --> |
225 | * @generated |
226 | */ |
227 | private final int value; |
228 | |
229 | /** |
230 | * <!-- begin-user-doc --> |
231 | * <!-- end-user-doc --> |
232 | * @generated |
233 | */ |
234 | private final String name; |
235 | |
236 | /** |
237 | * <!-- begin-user-doc --> |
238 | * <!-- end-user-doc --> |
239 | * @generated |
240 | */ |
241 | private final String literal; |
242 | |
243 | /** |
244 | * Only this class can construct instances. |
245 | * <!-- begin-user-doc --> |
246 | * <!-- end-user-doc --> |
247 | * @generated |
248 | */ |
249 | private PCMRERequestCategory(int value, String name, String literal) { |
250 | this.value = value; |
251 | this.name = name; |
252 | this.literal = literal; |
253 | } |
254 | |
255 | /** |
256 | * <!-- begin-user-doc --> |
257 | * <!-- end-user-doc --> |
258 | * @generated |
259 | */ |
260 | public int getValue() { |
261 | return value; |
262 | } |
263 | |
264 | /** |
265 | * <!-- begin-user-doc --> |
266 | * <!-- end-user-doc --> |
267 | * @generated |
268 | */ |
269 | public String getName() { |
270 | return name; |
271 | } |
272 | |
273 | /** |
274 | * <!-- begin-user-doc --> |
275 | * <!-- end-user-doc --> |
276 | * @generated |
277 | */ |
278 | public String getLiteral() { |
279 | return literal; |
280 | } |
281 | |
282 | /** |
283 | * Returns the literal value of the enumerator, which is its string representation. |
284 | * <!-- begin-user-doc --> |
285 | * <!-- end-user-doc --> |
286 | * @generated |
287 | */ |
288 | @Override |
289 | public String toString() { |
290 | return literal; |
291 | } |
292 | |
293 | } //PCMRERequestCategory |