Esempio n. 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;
 }
Esempio n. 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.");
 }