예제 #1
0
 @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;
 }
예제 #2
0
 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.");
 }