Example #1
0
 public static TradeTypeEnum getByCode(String code) {
   for (TradeTypeEnum type : TradeTypeEnum.values()) {
     if (type.getCode().equalsIgnoreCase(code)) {
       return type;
     }
   }
   return null;
 }
Example #2
0
 public static TradeTypeEnum getById(int id) {
   for (TradeTypeEnum type : TradeTypeEnum.values()) {
     if (type.getId() == id) {
       return type;
     }
   }
   return UNKNOWN;
 }