package com.bonus.canteen.core.menu.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum RoleCodeV2Enum {
   ROLE_SUPER_ADMIN("ROLE_ADMIN", "管理员"),
   ROLE_ADMIN("ROLE_ADMIN", "全数据类"),
   ROLE_ORG("ROLE_ORG", "组织类"),
   ROLE_MERCHANT("ROLE_MERCHANT", "商户/仓库类");

   private final String key;
   private final String value;

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

   public static String getKey(String value) {
      RoleCodeV2Enum[] roleCodeEnums = values();
      RoleCodeV2Enum[] var2 = roleCodeEnums;
      int var3 = roleCodeEnums.length;

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

      return null;
   }

   public static String getValue(String key) {
      RoleCodeV2Enum[] roleCodeEnums = values();
      RoleCodeV2Enum[] var2 = roleCodeEnums;
      int var3 = roleCodeEnums.length;

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

      return null;
   }

   public static List<Map<String, String>> getAllEnumsList() {
      RoleCodeV2Enum[] roleCodeEnums = values();
      List<Map<String, String>> roleCodeList = new ArrayList();
      RoleCodeV2Enum[] var2 = roleCodeEnums;
      int var3 = roleCodeEnums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         RoleCodeV2Enum roleCodeEnum = var2[var4];
         Map<String, String> roleCodeMap = new HashMap();
         roleCodeMap.put("key", roleCodeEnum.key);
         roleCodeMap.put("value", roleCodeEnum.value);
         roleCodeList.add(roleCodeMap);
      }

      return roleCodeList;
   }

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

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

   // $FF: synthetic method
   private static RoleCodeV2Enum[] $values() {
      return new RoleCodeV2Enum[]{ROLE_SUPER_ADMIN, ROLE_ADMIN, ROLE_ORG, ROLE_MERCHANT};
   }
}
