@JsonCreator public static List<DeviceFlag> getDeviceFlag(int value) { List<DeviceFlag> flags = new ArrayList<DeviceFlag>(); for (DeviceFlag flag : DeviceFlag.values()) { if (flag.value == value) flags.add(flag); } return flags; }
public static DeviceFlag findDeviceFlag(int value) { for (DeviceFlag flag : DeviceFlag.values()) { if (flag.value == value) return flag; } throw new IllegalArgumentException("Value: [" + value + "] not valid for DeviceFlag."); }