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


import com.bonus.canteen.core.common.converter.LeExcelFieldConvertor;
import com.bonus.canteen.core.common.converter.LeExcelFieldEnum;

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

public enum NuclearModeEnum implements LeExcelFieldEnum<NuclearModeEnum> {
   NUCLEAR_MODE_TALLY(0, "记账"),
   NUCLEAR_MODE_CREDIT(1, "刷卡"),
   NUCLEAR_MODE_BRUSH(2, "刷脸"),
   NUCLEAR_MODE_QRCODE(3, "扫码"),
   NUCLEAR_MODE_DEDUTION(4, "补扣");

   private final Integer key;
   private final String desc;

   private NuclearModeEnum(Integer key, String desc) {
      this.key = key;
      this.desc = desc;
   }

   public static String getDesc(Integer key) {
      NuclearModeEnum[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         NuclearModeEnum temp = var1[var3];
         if (temp.getKey().equals(key)) {
            return temp.getDesc();
         }
      }

      return "";
   }

   public static List<Map<String, Object>> getAllEnumsList() {
      NuclearModeEnum[] enums = values();
      List<Map<String, Object>> list = new ArrayList();
      NuclearModeEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         NuclearModeEnum modeEnum = var2[var4];
         Map<String, Object> map = new HashMap();
         map.put("key", modeEnum.getKey().toString());
         map.put("value", modeEnum.getDesc());
         list.add(map);
      }

      return list;
   }

   public static boolean isCard(Integer mode) {
      return NUCLEAR_MODE_CREDIT.getKey().equals(mode);
   }

   public static boolean isQrCode(Integer mode) {
      return NUCLEAR_MODE_QRCODE.getKey().equals(mode);
   }

   public static boolean isTally(Integer mode) {
      return NUCLEAR_MODE_TALLY.getKey().equals(mode);
   }

   public static boolean isFace(Integer mode) {
      return NUCLEAR_MODE_BRUSH.getKey().equals(mode);
   }

   @Override
   public Integer getKey() {
      return this.key;
   }

   @Override
   public String getDesc() {
      return this.desc;
   }

   // $FF: synthetic method
   private static NuclearModeEnum[] $values() {
      return new NuclearModeEnum[]{NUCLEAR_MODE_TALLY, NUCLEAR_MODE_CREDIT, NUCLEAR_MODE_BRUSH, NUCLEAR_MODE_QRCODE, NUCLEAR_MODE_DEDUTION};
   }

   public static class ExcelConvertor extends LeExcelFieldConvertor<NuclearModeEnum> {
      public ExcelConvertor() {
         super(NuclearModeEnum.class);
      }
   }
}
