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