public static AbnormalState getStateById(int id) { for (AbnormalState as : values()) { if (as.getId() == id) return as; } return null; }
public static AbnormalState getIdByName(String name) { for (AbnormalState id : values()) { if (id.name().equals(name)) return id; } return null; }