package com.bonus.core.pay.common.constants;

public enum TradeTypeEnum {
   RECHARGE(1, "充值"),
   RECHARGE_REFUND(2, "充值退款"),
   CONSUME(3, "消费"),
   CONSUME_REFUND(4, "消费退款");

   private final Integer key;
   private final String desc;

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

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

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

      return "";
   }

   public static boolean isConsumeType(Integer key) {
      return CONSUME.getKey().equals(key);
   }

   public static boolean isRechargeType(Integer key) {
      return RECHARGE.getKey().equals(key);
   }

   public static boolean isConsumeRefundType(Integer key) {
      return CONSUME_REFUND.getKey().equals(key);
   }

   public static boolean isRechargeRefundType(Integer key) {
      return RECHARGE_REFUND.getKey().equals(key);
   }

   public static boolean isPayCategory(Integer key) {
      return isConsumeType(key) || isRechargeType(key);
   }

   public static boolean isRefundCategory(Integer key) {
      return isConsumeRefundType(key) || isRechargeRefundType(key);
   }

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

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

   // $FF: synthetic method
   private static TradeTypeEnum[] $values() {
      return new TradeTypeEnum[]{RECHARGE, RECHARGE_REFUND, CONSUME, CONSUME_REFUND};
   }
}
