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