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)); }
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); }