コード例 #1
0
 public static AbnormalState getStateById(int id) {
   for (AbnormalState as : values()) {
     if (as.getId() == id) return as;
   }
   return null;
 }
コード例 #2
0
 public static AbnormalState getIdByName(String name) {
   for (AbnormalState id : values()) {
     if (id.name().equals(name)) return id;
   }
   return null;
 }