001/**
002 */
003package org.nasdanika.models.gitlab;
004
005import java.util.Arrays;
006import java.util.Collections;
007import java.util.List;
008
009import org.eclipse.emf.common.util.Enumerator;
010
011/**
012 * <!-- begin-user-doc -->
013 * A representation of the literals of the enumeration '<em><b>Squash Option</b></em>',
014 * and utility methods for working with them.
015 * <!-- end-user-doc -->
016 * @see org.nasdanika.models.gitlab.GitLabPackage#getSquashOption()
017 * @model
018 * @generated
019 */
020public enum SquashOption implements Enumerator {
021        /**
022         * The '<em><b>Never</b></em>' literal object.
023         * <!-- begin-user-doc -->
024         * <!-- end-user-doc -->
025         * @see #NEVER_VALUE
026         * @generated
027         * @ordered
028         */
029        NEVER(0, "Never", "Info"),
030
031        /**
032         * The '<em><b>Always</b></em>' literal object.
033         * <!-- begin-user-doc -->
034         * <!-- end-user-doc -->
035         * @see #ALWAYS_VALUE
036         * @generated
037         * @ordered
038         */
039        ALWAYS(1, "Always", "Always"),
040
041        /**
042         * The '<em><b>Default On</b></em>' literal object.
043         * <!-- begin-user-doc -->
044         * <!-- end-user-doc -->
045         * @see #DEFAULT_ON_VALUE
046         * @generated
047         * @ordered
048         */
049        DEFAULT_ON(2, "DefaultOn", "DefaultOn"),
050
051        /**
052         * The '<em><b>Default Off</b></em>' literal object.
053         * <!-- begin-user-doc -->
054         * <!-- end-user-doc -->
055         * @see #DEFAULT_OFF_VALUE
056         * @generated
057         * @ordered
058         */
059        DEFAULT_OFF(3, "DefaultOff", "DefaultOff");
060
061        /**
062         * The '<em><b>Never</b></em>' literal value.
063         * <!-- begin-user-doc -->
064         * <!-- end-user-doc -->
065         * @see #NEVER
066         * @model name="Never" literal="Info"
067         * @generated
068         * @ordered
069         */
070        public static final int NEVER_VALUE = 0;
071
072        /**
073         * The '<em><b>Always</b></em>' literal value.
074         * <!-- begin-user-doc -->
075         * <!-- end-user-doc -->
076         * @see #ALWAYS
077         * @model name="Always"
078         * @generated
079         * @ordered
080         */
081        public static final int ALWAYS_VALUE = 1;
082
083        /**
084         * The '<em><b>Default On</b></em>' literal value.
085         * <!-- begin-user-doc -->
086         * <!-- end-user-doc -->
087         * @see #DEFAULT_ON
088         * @model name="DefaultOn"
089         * @generated
090         * @ordered
091         */
092        public static final int DEFAULT_ON_VALUE = 2;
093
094        /**
095         * The '<em><b>Default Off</b></em>' literal value.
096         * <!-- begin-user-doc -->
097         * <!-- end-user-doc -->
098         * @see #DEFAULT_OFF
099         * @model name="DefaultOff"
100         * @generated
101         * @ordered
102         */
103        public static final int DEFAULT_OFF_VALUE = 3;
104
105        /**
106         * An array of all the '<em><b>Squash Option</b></em>' enumerators.
107         * <!-- begin-user-doc -->
108         * <!-- end-user-doc -->
109         * @generated
110         */
111        private static final SquashOption[] VALUES_ARRAY =
112                new SquashOption[] {
113                        NEVER,
114                        ALWAYS,
115                        DEFAULT_ON,
116                        DEFAULT_OFF,
117                };
118
119        /**
120         * A public read-only list of all the '<em><b>Squash Option</b></em>' enumerators.
121         * <!-- begin-user-doc -->
122         * <!-- end-user-doc -->
123         * @generated
124         */
125        public static final List<SquashOption> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
126
127        /**
128         * Returns the '<em><b>Squash Option</b></em>' literal with the specified literal value.
129         * <!-- begin-user-doc -->
130         * <!-- end-user-doc -->
131         * @param literal the literal.
132         * @return the matching enumerator or <code>null</code>.
133         * @generated
134         */
135        public static SquashOption get(String literal) {
136                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
137                        SquashOption result = VALUES_ARRAY[i];
138                        if (result.toString().equals(literal)) {
139                                return result;
140                        }
141                }
142                return null;
143        }
144
145        /**
146         * Returns the '<em><b>Squash Option</b></em>' literal with the specified name.
147         * <!-- begin-user-doc -->
148         * <!-- end-user-doc -->
149         * @param name the name.
150         * @return the matching enumerator or <code>null</code>.
151         * @generated
152         */
153        public static SquashOption getByName(String name) {
154                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
155                        SquashOption result = VALUES_ARRAY[i];
156                        if (result.getName().equals(name)) {
157                                return result;
158                        }
159                }
160                return null;
161        }
162
163        /**
164         * Returns the '<em><b>Squash Option</b></em>' literal with the specified integer value.
165         * <!-- begin-user-doc -->
166         * <!-- end-user-doc -->
167         * @param value the integer value.
168         * @return the matching enumerator or <code>null</code>.
169         * @generated
170         */
171        public static SquashOption get(int value) {
172                switch (value) {
173                        case NEVER_VALUE: return NEVER;
174                        case ALWAYS_VALUE: return ALWAYS;
175                        case DEFAULT_ON_VALUE: return DEFAULT_ON;
176                        case DEFAULT_OFF_VALUE: return DEFAULT_OFF;
177                }
178                return null;
179        }
180
181        /**
182         * <!-- begin-user-doc -->
183         * <!-- end-user-doc -->
184         * @generated
185         */
186        private final int value;
187
188        /**
189         * <!-- begin-user-doc -->
190         * <!-- end-user-doc -->
191         * @generated
192         */
193        private final String name;
194
195        /**
196         * <!-- begin-user-doc -->
197         * <!-- end-user-doc -->
198         * @generated
199         */
200        private final String literal;
201
202        /**
203         * Only this class can construct instances.
204         * <!-- begin-user-doc -->
205         * <!-- end-user-doc -->
206         * @generated
207         */
208        private SquashOption(int value, String name, String literal) {
209                this.value = value;
210                this.name = name;
211                this.literal = literal;
212        }
213
214        /**
215         * <!-- begin-user-doc -->
216         * <!-- end-user-doc -->
217         * @generated
218         */
219        @Override
220        public int getValue() {
221          return value;
222        }
223
224        /**
225         * <!-- begin-user-doc -->
226         * <!-- end-user-doc -->
227         * @generated
228         */
229        @Override
230        public String getName() {
231          return name;
232        }
233
234        /**
235         * <!-- begin-user-doc -->
236         * <!-- end-user-doc -->
237         * @generated
238         */
239        @Override
240        public String getLiteral() {
241          return literal;
242        }
243
244        /**
245         * Returns the literal value of the enumerator, which is its string representation.
246         * <!-- begin-user-doc -->
247         * <!-- end-user-doc -->
248         * @generated
249         */
250        @Override
251        public String toString() {
252                return literal;
253        }
254        
255} //SquashOption