package com.bonus.constant;

import java.util.HashMap;
import java.util.Map;

public enum CustLoginTypeEnum {
   NAME_PWD(1, "姓名+密码"),
   TEL_PWD(2, "手机号+密码"),
   TEL_CODE(3, "手机号+验证码"),
   NAME_CUST_NUM_PWD(4, "姓名+工号+密码"),
   ID_CARD_PWD(5, "身份证号+密码");

   private final Integer key;
   private final String value;

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

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

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

      return null;
   }

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

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

      return null;
   }

   public static Map<Integer, String> getLoginTypeToMap() {
      Map<Integer, String> map = new HashMap();
      CustLoginTypeEnum[] enums = values();
      CustLoginTypeEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         CustLoginTypeEnum temp = var2[var4];
         map.put(temp.key, temp.value);
      }

      return map;
   }

   public static Map<Integer, String> getNeedPasswordLoginTypeToMap() {
      HashMap<Integer, String> map = new HashMap();
      map.put(TEL_PWD.key, TEL_PWD.value);
      map.put(NAME_PWD.key, NAME_PWD.value);
      map.put(NAME_CUST_NUM_PWD.key, NAME_CUST_NUM_PWD.value);
      map.put(ID_CARD_PWD.key, ID_CARD_PWD.value);
      return map;
   }

   public static boolean contains(Integer loginType) {
      CustLoginTypeEnum[] enums = values();
      CustLoginTypeEnum[] var2 = enums;
      int var3 = enums.length;

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

      return false;
   }

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

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