package com.bonus.canteen.core.drp.constant;

import com.google.common.collect.Lists;

import java.util.List;

public enum DrpInventoryStatusEnum {
   NORMAL(1, "正常"),
   INSUFFICIENT(2, "不足"),
   EXCESS(3, "超额");

   private final Integer key;
   private final String value;

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

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

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

      return null;
   }

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

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

      return null;
   }

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

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

   public static List<Integer> listOverAndNotEnough() {
      return Lists.newArrayList(new Integer[]{INSUFFICIENT.key, EXCESS.key});
   }
}
