| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package edu.kit.ipd.sdq.completionfeaturemodel; |
| 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>Feature State</b></em>', |
| 18 | * and utility methods for working with them. |
| 19 | * <!-- end-user-doc --> |
| 20 | * @see edu.kit.ipd.sdq.completionfeaturemodel.completionfeaturemodelPackage#getFeatureState() |
| 21 | * @model |
| 22 | * @generated |
| 23 | */ |
| 24 | public enum FeatureState implements Enumerator { |
| 25 | /** |
| 26 | * The '<em><b>NOT SET</b></em>' literal object. |
| 27 | * <!-- begin-user-doc --> |
| 28 | * <!-- end-user-doc --> |
| 29 | * @see #NOT_SET_VALUE |
| 30 | * @generated |
| 31 | * @ordered |
| 32 | */ |
| 33 | NOT_SET(0, "NOT_SET", "NOT_SET"), |
| 34 | |
| 35 | /** |
| 36 | * The '<em><b>OPTIONAL</b></em>' literal object. |
| 37 | * <!-- begin-user-doc --> |
| 38 | * <!-- end-user-doc --> |
| 39 | * @see #OPTIONAL_VALUE |
| 40 | * @generated |
| 41 | * @ordered |
| 42 | */ |
| 43 | OPTIONAL(1, "OPTIONAL", "OPTIONAL"), |
| 44 | |
| 45 | /** |
| 46 | * The '<em><b>MANDATORY</b></em>' literal object. |
| 47 | * <!-- begin-user-doc --> |
| 48 | * <!-- end-user-doc --> |
| 49 | * @see #MANDATORY_VALUE |
| 50 | * @generated |
| 51 | * @ordered |
| 52 | */ |
| 53 | MANDATORY(2, "MANDATORY", "MANDATORY"); |
| 54 | |
| 55 | /** |
| 56 | * The '<em><b>NOT SET</b></em>' literal value. |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <p> |
| 59 | * If the meaning of '<em><b>NOT SET</b></em>' literal object isn't clear, |
| 60 | * there really should be more of a description here... |
| 61 | * </p> |
| 62 | * <!-- end-user-doc --> |
| 63 | * @see #NOT_SET |
| 64 | * @model |
| 65 | * @generated |
| 66 | * @ordered |
| 67 | */ |
| 68 | public static final int NOT_SET_VALUE = 0; |
| 69 | |
| 70 | /** |
| 71 | * The '<em><b>OPTIONAL</b></em>' literal value. |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <p> |
| 74 | * If the meaning of '<em><b>OPTIONAL</b></em>' literal object isn't clear, |
| 75 | * there really should be more of a description here... |
| 76 | * </p> |
| 77 | * <!-- end-user-doc --> |
| 78 | * @see #OPTIONAL |
| 79 | * @model |
| 80 | * @generated |
| 81 | * @ordered |
| 82 | */ |
| 83 | public static final int OPTIONAL_VALUE = 1; |
| 84 | |
| 85 | /** |
| 86 | * The '<em><b>MANDATORY</b></em>' literal value. |
| 87 | * <!-- begin-user-doc --> |
| 88 | * <p> |
| 89 | * If the meaning of '<em><b>MANDATORY</b></em>' literal object isn't clear, |
| 90 | * there really should be more of a description here... |
| 91 | * </p> |
| 92 | * <!-- end-user-doc --> |
| 93 | * @see #MANDATORY |
| 94 | * @model |
| 95 | * @generated |
| 96 | * @ordered |
| 97 | */ |
| 98 | public static final int MANDATORY_VALUE = 2; |
| 99 | |
| 100 | /** |
| 101 | * An array of all the '<em><b>Feature State</b></em>' enumerators. |
| 102 | * <!-- begin-user-doc --> |
| 103 | * <!-- end-user-doc --> |
| 104 | * @generated |
| 105 | */ |
| 106 | private static final FeatureState[] VALUES_ARRAY = |
| 107 | new FeatureState[] { |
| 108 | NOT_SET, |
| 109 | OPTIONAL, |
| 110 | MANDATORY, |
| 111 | }; |
| 112 | |
| 113 | /** |
| 114 | * A public read-only list of all the '<em><b>Feature State</b></em>' enumerators. |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <!-- end-user-doc --> |
| 117 | * @generated |
| 118 | */ |
| 119 | public static final List<FeatureState> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| 120 | |
| 121 | /** |
| 122 | * Returns the '<em><b>Feature State</b></em>' literal with the specified literal value. |
| 123 | * <!-- begin-user-doc --> |
| 124 | * <!-- end-user-doc --> |
| 125 | * @generated |
| 126 | */ |
| 127 | public static FeatureState get(String literal) { |
| 128 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 129 | FeatureState result = VALUES_ARRAY[i]; |
| 130 | if (result.toString().equals(literal)) { |
| 131 | return result; |
| 132 | } |
| 133 | } |
| 134 | return null; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Returns the '<em><b>Feature State</b></em>' literal with the specified name. |
| 139 | * <!-- begin-user-doc --> |
| 140 | * <!-- end-user-doc --> |
| 141 | * @generated |
| 142 | */ |
| 143 | public static FeatureState getByName(String name) { |
| 144 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 145 | FeatureState result = VALUES_ARRAY[i]; |
| 146 | if (result.getName().equals(name)) { |
| 147 | return result; |
| 148 | } |
| 149 | } |
| 150 | return null; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * Returns the '<em><b>Feature State</b></em>' literal with the specified integer value. |
| 155 | * <!-- begin-user-doc --> |
| 156 | * <!-- end-user-doc --> |
| 157 | * @generated |
| 158 | */ |
| 159 | public static FeatureState get(int value) { |
| 160 | switch (value) { |
| 161 | case NOT_SET_VALUE: return NOT_SET; |
| 162 | case OPTIONAL_VALUE: return OPTIONAL; |
| 163 | case MANDATORY_VALUE: return MANDATORY; |
| 164 | } |
| 165 | return null; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * <!-- begin-user-doc --> |
| 170 | * <!-- end-user-doc --> |
| 171 | * @generated |
| 172 | */ |
| 173 | private final int value; |
| 174 | |
| 175 | /** |
| 176 | * <!-- begin-user-doc --> |
| 177 | * <!-- end-user-doc --> |
| 178 | * @generated |
| 179 | */ |
| 180 | private final String name; |
| 181 | |
| 182 | /** |
| 183 | * <!-- begin-user-doc --> |
| 184 | * <!-- end-user-doc --> |
| 185 | * @generated |
| 186 | */ |
| 187 | private final String literal; |
| 188 | |
| 189 | /** |
| 190 | * Only this class can construct instances. |
| 191 | * <!-- begin-user-doc --> |
| 192 | * <!-- end-user-doc --> |
| 193 | * @generated |
| 194 | */ |
| 195 | private FeatureState(int value, String name, String literal) { |
| 196 | this.value = value; |
| 197 | this.name = name; |
| 198 | this.literal = literal; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * <!-- begin-user-doc --> |
| 203 | * <!-- end-user-doc --> |
| 204 | * @generated |
| 205 | */ |
| 206 | public int getValue() { |
| 207 | return value; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * <!-- begin-user-doc --> |
| 212 | * <!-- end-user-doc --> |
| 213 | * @generated |
| 214 | */ |
| 215 | public String getName() { |
| 216 | return name; |
| 217 | } |
| 218 | |
| 219 | /** |
| 220 | * <!-- begin-user-doc --> |
| 221 | * <!-- end-user-doc --> |
| 222 | * @generated |
| 223 | */ |
| 224 | public String getLiteral() { |
| 225 | return literal; |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * Returns the literal value of the enumerator, which is its string representation. |
| 230 | * <!-- begin-user-doc --> |
| 231 | * <!-- end-user-doc --> |
| 232 | * @generated |
| 233 | */ |
| 234 | @Override |
| 235 | public String toString() { |
| 236 | return literal; |
| 237 | } |
| 238 | |
| 239 | } //FeatureState |