package com.bonus.canteen.core.device.constants;

public enum DeviceOnlineStatusEnum {
   ONLINE_STATUS_ENUM(1, "在线"),
   OFFLINE_STATUS_ENUM(2, "离线");

   private final Integer key;
   private final String value;

   private DeviceOnlineStatusEnum(Integer key, String value) {
      this.key = key;
      this.value = value;
   }

   public static Integer getKey(String value) {
      DeviceOnlineStatusEnum[] printerOrdStatuses = values();
      DeviceOnlineStatusEnum[] var2 = printerOrdStatuses;
      int var3 = printerOrdStatuses.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         DeviceOnlineStatusEnum printerOrdStatus = var2[var4];
         if (printerOrdStatus.value().equals(value)) {
            return printerOrdStatus.key();
         }
      }

      return null;
   }

   public static String getValue(Integer key) {
      DeviceOnlineStatusEnum[] printerOrdStatuses = values();
      DeviceOnlineStatusEnum[] var2 = printerOrdStatuses;
      int var3 = printerOrdStatuses.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         DeviceOnlineStatusEnum printerOrdStatus = var2[var4];
         if (printerOrdStatus.key().equals(key)) {
            return printerOrdStatus.value();
         }
      }

      return null;
   }

   public Integer key() {
      return this.key;
   }

   public String value() {
      return this.value;
   }

}
