Skip to content

Package: Severity

Severity

nameinstructionbranchcomplexitylinemethod
Severity(String, int, int, String, String)
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
get(String)
M: 21 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
get(int)
M: 14 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getByName(String)
M: 21 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getLiteral()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getValue()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 96
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 13
100%
M: 0 C: 1
100%
toString()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.spreadsheet.core.error.model;
15:
16: import java.util.Arrays;
17: import java.util.Collections;
18: import java.util.List;
19:
20: import org.eclipse.emf.common.util.Enumerator;
21:
22: /**
23: * <!-- begin-user-doc -->
24: * A representation of the literals of the enumeration '<em><b>Severity</b></em>',
25: * and utility methods for working with them.
26: * <!-- end-user-doc -->
27: *
28: * @see org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorPackage#getSeverity()
29: * @model
30: * @generated
31: */
32: public enum Severity implements Enumerator {
33:         /**
34:          * The '<em><b>OK</b></em>' literal object.
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @see #OK_VALUE
39:          * @generated
40:          * @ordered
41:          */
42:         OK(0, "OK", "OK"), //$NON-NLS-1$ //$NON-NLS-2$
43:
44:         /**
45:          * The '<em><b>INFO</b></em>' literal object.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @see #INFO_VALUE
50:          * @generated
51:          * @ordered
52:          */
53:         INFO(1, "INFO", "INFO"), //$NON-NLS-1$ //$NON-NLS-2$
54:
55:         /**
56:          * The '<em><b>WARNING</b></em>' literal object.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @see #WARNING_VALUE
61:          * @generated
62:          * @ordered
63:          */
64:         WARNING(2, "WARNING", "WARNING"), //$NON-NLS-1$ //$NON-NLS-2$
65:
66:         /**
67:          * The '<em><b>ERROR</b></em>' literal object.
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @see #ERROR_VALUE
72:          * @generated
73:          * @ordered
74:          */
75:         ERROR(4, "ERROR", "ERROR"), //$NON-NLS-1$ //$NON-NLS-2$
76:
77:         /**
78:          * The '<em><b>CANCEL</b></em>' literal object.
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @see #CANCEL_VALUE
83:          * @generated
84:          * @ordered
85:          */
86:         CANCEL(8, "CANCEL", "CANCEL"); //$NON-NLS-1$ //$NON-NLS-2$
87:
88:         /**
89:          * The '<em><b>OK</b></em>' literal value.
90:          * <!-- begin-user-doc -->
91:          * <p>
92:          * If the meaning of '<em><b>OK</b></em>' literal object isn't clear,
93:          * there really should be more of a description here...
94:          * </p>
95:          * <!-- end-user-doc -->
96:          *
97:          * @see #OK
98:          * @model
99:          * @generated
100:          * @ordered
101:          */
102:         public static final int OK_VALUE = 0;
103:
104:         /**
105:          * The '<em><b>INFO</b></em>' literal value.
106:          * <!-- begin-user-doc -->
107:          * <p>
108:          * If the meaning of '<em><b>INFO</b></em>' literal object isn't clear,
109:          * there really should be more of a description here...
110:          * </p>
111:          * <!-- end-user-doc -->
112:          *
113:          * @see #INFO
114:          * @model
115:          * @generated
116:          * @ordered
117:          */
118:         public static final int INFO_VALUE = 1;
119:
120:         /**
121:          * The '<em><b>WARNING</b></em>' literal value.
122:          * <!-- begin-user-doc -->
123:          * <p>
124:          * If the meaning of '<em><b>WARNING</b></em>' literal object isn't clear,
125:          * there really should be more of a description here...
126:          * </p>
127:          * <!-- end-user-doc -->
128:          *
129:          * @see #WARNING
130:          * @model
131:          * @generated
132:          * @ordered
133:          */
134:         public static final int WARNING_VALUE = 2;
135:
136:         /**
137:          * The '<em><b>ERROR</b></em>' literal value.
138:          * <!-- begin-user-doc -->
139:          * <p>
140:          * If the meaning of '<em><b>ERROR</b></em>' literal object isn't clear,
141:          * there really should be more of a description here...
142:          * </p>
143:          * <!-- end-user-doc -->
144:          *
145:          * @see #ERROR
146:          * @model
147:          * @generated
148:          * @ordered
149:          */
150:         public static final int ERROR_VALUE = 4;
151:
152:         /**
153:          * The '<em><b>CANCEL</b></em>' literal value.
154:          * <!-- begin-user-doc -->
155:          * <p>
156:          * If the meaning of '<em><b>CANCEL</b></em>' literal object isn't clear,
157:          * there really should be more of a description here...
158:          * </p>
159:          * <!-- end-user-doc -->
160:          *
161:          * @see #CANCEL
162:          * @model
163:          * @generated
164:          * @ordered
165:          */
166:         public static final int CANCEL_VALUE = 8;
167:
168:         /**
169:          * An array of all the '<em><b>Severity</b></em>' enumerators.
170:          * <!-- begin-user-doc -->
171:          * <!-- end-user-doc -->
172:          *
173:          * @generated
174:          */
175:         private static final Severity[] VALUES_ARRAY = new Severity[] {
176:                 OK,
177:                 INFO,
178:                 WARNING,
179:                 ERROR,
180:                 CANCEL,
181:         };
182:
183:         /**
184:          * A public read-only list of all the '<em><b>Severity</b></em>' enumerators.
185:          * <!-- begin-user-doc -->
186:          * <!-- end-user-doc -->
187:          *
188:          * @generated
189:          */
190:         public static final List<Severity> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
191:
192:         /**
193:          * Returns the '<em><b>Severity</b></em>' literal with the specified literal value.
194:          * <!-- begin-user-doc -->
195:          * <!-- end-user-doc -->
196:          *
197:          * @param literal the literal.
198:          * @return the matching enumerator or <code>null</code>.
199:          * @generated
200:          */
201:         public static Severity get(String literal) {
202:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
203:                         final Severity result = VALUES_ARRAY[i];
204:•                        if (result.toString().equals(literal)) {
205:                                 return result;
206:                         }
207:                 }
208:                 return null;
209:         }
210:
211:         /**
212:          * Returns the '<em><b>Severity</b></em>' literal with the specified name.
213:          * <!-- begin-user-doc -->
214:          * <!-- end-user-doc -->
215:          *
216:          * @param name the name.
217:          * @return the matching enumerator or <code>null</code>.
218:          * @generated
219:          */
220:         public static Severity getByName(String name) {
221:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
222:                         final Severity result = VALUES_ARRAY[i];
223:•                        if (result.getName().equals(name)) {
224:                                 return result;
225:                         }
226:                 }
227:                 return null;
228:         }
229:
230:         /**
231:          * Returns the '<em><b>Severity</b></em>' literal with the specified integer value.
232:          * <!-- begin-user-doc -->
233:          * <!-- end-user-doc -->
234:          *
235:          * @param value the integer value.
236:          * @return the matching enumerator or <code>null</code>.
237:          * @generated
238:          */
239:         public static Severity get(int value) {
240:•                switch (value) {
241:                 case OK_VALUE:
242:                         return OK;
243:                 case INFO_VALUE:
244:                         return INFO;
245:                 case WARNING_VALUE:
246:                         return WARNING;
247:                 case ERROR_VALUE:
248:                         return ERROR;
249:                 case CANCEL_VALUE:
250:                         return CANCEL;
251:                 }
252:                 return null;
253:         }
254:
255:         /**
256:          * <!-- begin-user-doc -->
257:          * <!-- end-user-doc -->
258:          *
259:          * @generated
260:          */
261:         private final int value;
262:
263:         /**
264:          * <!-- begin-user-doc -->
265:          * <!-- end-user-doc -->
266:          *
267:          * @generated
268:          */
269:         private final String name;
270:
271:         /**
272:          * <!-- begin-user-doc -->
273:          * <!-- end-user-doc -->
274:          *
275:          * @generated
276:          */
277:         private final String literal;
278:
279:         /**
280:          * Only this class can construct instances.
281:          * <!-- begin-user-doc -->
282:          * <!-- end-user-doc -->
283:          *
284:          * @generated
285:          */
286:         private Severity(int value, String name, String literal) {
287:                 this.value = value;
288:                 this.name = name;
289:                 this.literal = literal;
290:         }
291:
292:         /**
293:          * <!-- begin-user-doc -->
294:          * <!-- end-user-doc -->
295:          *
296:          * @generated
297:          */
298:         @Override
299:         public int getValue() {
300:                 return value;
301:         }
302:
303:         /**
304:          * <!-- begin-user-doc -->
305:          * <!-- end-user-doc -->
306:          *
307:          * @generated
308:          */
309:         @Override
310:         public String getName() {
311:                 return name;
312:         }
313:
314:         /**
315:          * <!-- begin-user-doc -->
316:          * <!-- end-user-doc -->
317:          *
318:          * @generated
319:          */
320:         @Override
321:         public String getLiteral() {
322:                 return literal;
323:         }
324:
325:         /**
326:          * Returns the literal value of the enumerator, which is its string representation.
327:          * <!-- begin-user-doc -->
328:          * <!-- end-user-doc -->
329:          *
330:          * @generated
331:          */
332:         @Override
333:         public String toString() {
334:                 return literal;
335:         }
336:
337: } // Severity