View Javadoc

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>Method Type</b></em>',
18   * and utility methods for working with them.
19   * <!-- end-user-doc -->
20   * @see org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage#getMethodType()
21   * @model
22   * @generated
23   */
24  public enum MethodType implements Enumerator {
25      /**
26       * The '<em><b>CREATE</b></em>' literal object.
27       * <!-- begin-user-doc -->
28       * <!-- end-user-doc -->
29       * @see #CREATE_VALUE
30       * @generated
31       * @ordered
32       */
33      CREATE(0, "CREATE", "Create"),
34  
35      /**
36       * The '<em><b>READ</b></em>' literal object.
37       * <!-- begin-user-doc -->
38       * <!-- end-user-doc -->
39       * @see #READ_VALUE
40       * @generated
41       * @ordered
42       */
43      READ(1, "READ", "READ"),
44  
45      /**
46       * The '<em><b>UPDATE</b></em>' literal object.
47       * <!-- begin-user-doc -->
48       * <!-- end-user-doc -->
49       * @see #UPDATE_VALUE
50       * @generated
51       * @ordered
52       */
53      UPDATE(2, "UPDATE", "UPDATE"),
54  
55      /**
56       * The '<em><b>DELETE</b></em>' literal object.
57       * <!-- begin-user-doc -->
58       * <!-- end-user-doc -->
59       * @see #DELETE_VALUE
60       * @generated
61       * @ordered
62       */
63      DELETE(3, "DELETE", "DELETE"),
64  
65      /**
66       * The '<em><b>FIND</b></em>' literal object.
67       * <!-- begin-user-doc -->
68       * <!-- end-user-doc -->
69       * @see #FIND_VALUE
70       * @generated
71       * @ordered
72       */
73      FIND(4, "FIND", "FIND"),
74  
75      /**
76       * The '<em><b>CUSTOM</b></em>' literal object.
77       * <!-- begin-user-doc -->
78       * <!-- end-user-doc -->
79       * @see #CUSTOM_VALUE
80       * @generated
81       * @ordered
82       */
83      CUSTOM(5, "CUSTOM", "CUSTOM"),
84  
85      /**
86       * The '<em><b>ADDTO</b></em>' literal object.
87       * <!-- begin-user-doc -->
88       * <!-- end-user-doc -->
89       * @see #ADDTO_VALUE
90       * @generated
91       * @ordered
92       */
93      ADDTO(6, "ADDTO", "ADDTO"),
94  
95      /**
96       * The '<em><b>REMOVEFROM</b></em>' literal object.
97       * <!-- begin-user-doc -->
98       * <!-- end-user-doc -->
99       * @see #REMOVEFROM_VALUE
100      * @generated
101      * @ordered
102      */
103     REMOVEFROM(7, "REMOVEFROM", "REMOVEFROM"),
104 
105     /**
106      * The '<em><b>GETFROM</b></em>' literal object.
107      * <!-- begin-user-doc -->
108      * <!-- end-user-doc -->
109      * @see #GETFROM_VALUE
110      * @generated
111      * @ordered
112      */
113     GETFROM(8, "GETFROM", "GETFROM"), /**
114      * The '<em><b>LISTALL</b></em>' literal object.
115      * <!-- begin-user-doc -->
116      * <!-- end-user-doc -->
117      * @see #LISTALL_VALUE
118      * @generated
119      * @ordered
120      */
121     LISTALL(9, "LISTALL", "LISTALL");
122 
123     /**
124      * The '<em><b>CREATE</b></em>' literal value.
125      * <!-- begin-user-doc -->
126      * <p>
127      * If the meaning of '<em><b>CREATE</b></em>' literal object isn't clear,
128      * there really should be more of a description here...
129      * </p>
130      * <!-- end-user-doc -->
131      * @see #CREATE
132      * @model literal="Create"
133      * @generated
134      * @ordered
135      */
136     public static final int CREATE_VALUE = 0;
137 
138     /**
139      * The '<em><b>READ</b></em>' literal value.
140      * <!-- begin-user-doc -->
141      * <p>
142      * If the meaning of '<em><b>READ</b></em>' literal object isn't clear,
143      * there really should be more of a description here...
144      * </p>
145      * <!-- end-user-doc -->
146      * @see #READ
147      * @model
148      * @generated
149      * @ordered
150      */
151     public static final int READ_VALUE = 1;
152 
153     /**
154      * The '<em><b>UPDATE</b></em>' literal value.
155      * <!-- begin-user-doc -->
156      * <p>
157      * If the meaning of '<em><b>UPDATE</b></em>' literal object isn't clear,
158      * there really should be more of a description here...
159      * </p>
160      * <!-- end-user-doc -->
161      * @see #UPDATE
162      * @model
163      * @generated
164      * @ordered
165      */
166     public static final int UPDATE_VALUE = 2;
167 
168     /**
169      * The '<em><b>DELETE</b></em>' literal value.
170      * <!-- begin-user-doc -->
171      * <p>
172      * If the meaning of '<em><b>DELETE</b></em>' literal object isn't clear,
173      * there really should be more of a description here...
174      * </p>
175      * <!-- end-user-doc -->
176      * @see #DELETE
177      * @model
178      * @generated
179      * @ordered
180      */
181     public static final int DELETE_VALUE = 3;
182 
183     /**
184      * The '<em><b>FIND</b></em>' literal value.
185      * <!-- begin-user-doc -->
186      * <p>
187      * If the meaning of '<em><b>FIND</b></em>' literal object isn't clear,
188      * there really should be more of a description here...
189      * </p>
190      * <!-- end-user-doc -->
191      * @see #FIND
192      * @model
193      * @generated
194      * @ordered
195      */
196     public static final int FIND_VALUE = 4;
197 
198     /**
199      * The '<em><b>CUSTOM</b></em>' literal value.
200      * <!-- begin-user-doc -->
201      * <p>
202      * If the meaning of '<em><b>CUSTOM</b></em>' literal object isn't clear,
203      * there really should be more of a description here...
204      * </p>
205      * <!-- end-user-doc -->
206      * @see #CUSTOM
207      * @model
208      * @generated
209      * @ordered
210      */
211     public static final int CUSTOM_VALUE = 5;
212 
213     /**
214      * The '<em><b>ADDTO</b></em>' literal value.
215      * <!-- begin-user-doc -->
216      * <p>
217      * If the meaning of '<em><b>ADDTO</b></em>' literal object isn't clear,
218      * there really should be more of a description here...
219      * </p>
220      * <!-- end-user-doc -->
221      * @see #ADDTO
222      * @model
223      * @generated
224      * @ordered
225      */
226     public static final int ADDTO_VALUE = 6;
227 
228     /**
229      * The '<em><b>REMOVEFROM</b></em>' literal value.
230      * <!-- begin-user-doc -->
231      * <p>
232      * If the meaning of '<em><b>REMOVEFROM</b></em>' literal object isn't clear,
233      * there really should be more of a description here...
234      * </p>
235      * <!-- end-user-doc -->
236      * @see #REMOVEFROM
237      * @model
238      * @generated
239      * @ordered
240      */
241     public static final int REMOVEFROM_VALUE = 7;
242 
243     /**
244      * The '<em><b>GETFROM</b></em>' literal value.
245      * <!-- begin-user-doc -->
246      * <p>
247      * If the meaning of '<em><b>GETFROM</b></em>' literal object isn't clear,
248      * there really should be more of a description here...
249      * </p>
250      * <!-- end-user-doc -->
251      * @see #GETFROM
252      * @model
253      * @generated
254      * @ordered
255      */
256     public static final int GETFROM_VALUE = 8;
257 
258     /**
259      * The '<em><b>LISTALL</b></em>' literal value.
260      * <!-- begin-user-doc -->
261      * <p>
262      * If the meaning of '<em><b>LISTALL</b></em>' literal object isn't clear,
263      * there really should be more of a description here...
264      * </p>
265      * <!-- end-user-doc -->
266      * @see #LISTALL
267      * @model
268      * @generated
269      * @ordered
270      */
271     public static final int LISTALL_VALUE = 9;
272 
273     /**
274      * An array of all the '<em><b>Method Type</b></em>' enumerators.
275      * <!-- begin-user-doc -->
276      * <!-- end-user-doc -->
277      * @generated
278      */
279     private static final MethodType[] VALUES_ARRAY =
280         new MethodType[] {
281             CREATE,
282             READ,
283             UPDATE,
284             DELETE,
285             FIND,
286             CUSTOM,
287             ADDTO,
288             REMOVEFROM,
289             GETFROM,
290             LISTALL,
291         };
292 
293     /**
294      * A public read-only list of all the '<em><b>Method Type</b></em>' enumerators.
295      * <!-- begin-user-doc -->
296      * <!-- end-user-doc -->
297      * @generated
298      */
299     public static final List<MethodType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
300 
301     /**
302      * Returns the '<em><b>Method Type</b></em>' literal with the specified literal value.
303      * <!-- begin-user-doc -->
304      * <!-- end-user-doc -->
305      * @generated
306      */
307     public static MethodType get(String literal) {
308         for (int i = 0; i < VALUES_ARRAY.length; ++i) {
309             MethodType result = VALUES_ARRAY[i];
310             if (result.toString().equals(literal)) {
311                 return result;
312             }
313         }
314         return null;
315     }
316 
317     /**
318      * Returns the '<em><b>Method Type</b></em>' literal with the specified name.
319      * <!-- begin-user-doc -->
320      * <!-- end-user-doc -->
321      * @generated
322      */
323     public static MethodType getByName(String name) {
324         for (int i = 0; i < VALUES_ARRAY.length; ++i) {
325             MethodType result = VALUES_ARRAY[i];
326             if (result.getName().equals(name)) {
327                 return result;
328             }
329         }
330         return null;
331     }
332 
333     /**
334      * Returns the '<em><b>Method Type</b></em>' literal with the specified integer value.
335      * <!-- begin-user-doc -->
336      * <!-- end-user-doc -->
337      * @generated
338      */
339     public static MethodType get(int value) {
340         switch (value) {
341             case CREATE_VALUE: return CREATE;
342             case READ_VALUE: return READ;
343             case UPDATE_VALUE: return UPDATE;
344             case DELETE_VALUE: return DELETE;
345             case FIND_VALUE: return FIND;
346             case CUSTOM_VALUE: return CUSTOM;
347             case ADDTO_VALUE: return ADDTO;
348             case REMOVEFROM_VALUE: return REMOVEFROM;
349             case GETFROM_VALUE: return GETFROM;
350             case LISTALL_VALUE: return LISTALL;
351         }
352         return null;
353     }
354 
355     /**
356      * <!-- begin-user-doc -->
357      * <!-- end-user-doc -->
358      * @generated
359      */
360     private final int value;
361 
362     /**
363      * <!-- begin-user-doc -->
364      * <!-- end-user-doc -->
365      * @generated
366      */
367     private final String name;
368 
369     /**
370      * <!-- begin-user-doc -->
371      * <!-- end-user-doc -->
372      * @generated
373      */
374     private final String literal;
375 
376     /**
377      * Only this class can construct instances.
378      * <!-- begin-user-doc -->
379      * <!-- end-user-doc -->
380      * @generated
381      */
382     private MethodType(int value, String name, String literal) {
383         this.value = value;
384         this.name = name;
385         this.literal = literal;
386     }
387 
388     /**
389      * <!-- begin-user-doc -->
390      * <!-- end-user-doc -->
391      * @generated
392      */
393     public int getValue() {
394       return value;
395     }
396 
397     /**
398      * <!-- begin-user-doc -->
399      * <!-- end-user-doc -->
400      * @generated
401      */
402     public String getName() {
403       return name;
404     }
405 
406     /**
407      * <!-- begin-user-doc -->
408      * <!-- end-user-doc -->
409      * @generated
410      */
411     public String getLiteral() {
412       return literal;
413     }
414 
415     /**
416      * Returns the literal value of the enumerator, which is its string representation.
417      * <!-- begin-user-doc -->
418      * <!-- end-user-doc -->
419      * @generated
420      */
421     @Override
422     public String toString() {
423         return literal;
424     }
425     
426 } //MethodType