Пример #1
0
 public static ActionType getByCode(int code) {
   HashMap<Integer, ActionType> operators = new HashMap<Integer, ActionType>();
   for (ActionType operator : ActionType.values()) {
     operators.put(operator.getCode(), operator);
   }
   return operators.get(Integer.valueOf(code));
 }
Пример #2
0
 public static ActionType getByName(String name) {
   HashMap<String, ActionType> operators = new HashMap<String, ActionType>();
   for (ActionType operator : ActionType.values()) {
     operators.put(operator.name(), operator);
   }
   return operators.get(name);
 }