1 7 package Olj; 8 9 import java.util.Arrays ; 10 import java.util.Collections ; 11 import java.util.List ; 12 13 import org.eclipse.emf.common.util.AbstractEnumerator; 14 15 24 public final class ValueModeType3 extends AbstractEnumerator { 25 34 public static final int KEY = 0; 35 36 45 public static final int OVERWRITE = 1; 46 47 56 public static final int UPDATE = 2; 57 58 67 public static final int SET_IF_CREATED = 3; 68 69 81 public static final ValueModeType3 KEY_LITERAL = new ValueModeType3(KEY, "Key"); 82 83 95 public static final ValueModeType3 OVERWRITE_LITERAL = new ValueModeType3(OVERWRITE, "Overwrite"); 96 97 109 public static final ValueModeType3 UPDATE_LITERAL = new ValueModeType3(UPDATE, "Update"); 110 111 123 public static final ValueModeType3 SET_IF_CREATED_LITERAL = new ValueModeType3(SET_IF_CREATED, "SetIfCreated"); 124 125 131 private static final ValueModeType3[] VALUES_ARRAY = 132 new ValueModeType3[] { 133 KEY_LITERAL, 134 OVERWRITE_LITERAL, 135 UPDATE_LITERAL, 136 SET_IF_CREATED_LITERAL, 137 }; 138 139 145 public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); 146 147 153 public static ValueModeType3 get(String name) { 154 for (int i = 0; i < VALUES_ARRAY.length; ++i) { 155 ValueModeType3 result = VALUES_ARRAY[i]; 156 if (result.toString().equals(name)) { 157 return result; 158 } 159 } 160 return null; 161 } 162 163 169 public static ValueModeType3 get(int value) { 170 switch (value) { 171 case KEY: return KEY_LITERAL; 172 case OVERWRITE: return OVERWRITE_LITERAL; 173 case UPDATE: return UPDATE_LITERAL; 174 case SET_IF_CREATED: return SET_IF_CREATED_LITERAL; 175 } 176 return null; 177 } 178 179 185 private ValueModeType3(int value, String name) { 186 super(value, name); 187 } 188 189 } | Popular Tags |