package com.bonus.canteen.core.account.v3.constants;

import cn.hutool.core.collection.ListUtil;

public enum AccTradeStateEnum {
   CREATE(1, "待生效"),
   TAKE_EFFECT(2, "生效"),
   CANCELED(3, "已撤销"),
   CLOSE(4, "关闭");

   private final Integer key;
   private final String desc;

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

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

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

      return "";
   }

   public static AccTradeStateEnum getStateEnum(Integer key) {
      AccTradeStateEnum[] var1 = values();
      int var2 = var1.length;

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

      return null;
   }

   public static boolean ifNotAllowRepeal(Integer key) {
      return !ListUtil.toList(new Integer[]{TAKE_EFFECT.getKey()}).contains(key);
   }

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

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

   // $FF: synthetic method
   private static AccTradeStateEnum[] $values() {
      return new AccTradeStateEnum[]{CREATE, TAKE_EFFECT, CANCELED, CLOSE};
   }
}
