package com.bonus.canteen.core.supply.purchase.constants;

public enum MaterialTypeEnum {
   MATERIAL(1, "原料"),
   GOODS(2, "商品");

   private final Integer key;
   private final String value;

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

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

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

      return null;
   }

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

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

      return null;
   }

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

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