package com.bonus.canteen.core.marketing.coupon.constants;

import java.util.ArrayList;
import java.util.List;

public enum MktCouponStateEnum {
   NO_EFFECT(1, "未生效"),
   NO_USE(2, "未使用"),
   ALREADY_USE(3, "已使用"),
   ALREADY_OVERDUE(4, "已过期"),
   ALREADY_NULLIFY(5, "已作废");

   private final Integer key;
   private final String desc;

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

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

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

      return "";
   }

   public static Integer getkeyByDes(String dse) {
      MktCouponStateEnum[] var1 = values();
      int var2 = var1.length;

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

      return null;
   }

   public static List<Integer> getNoUseState() {
      return new ArrayList<Integer>() {
         {
            this.add(MktCouponStateEnum.NO_EFFECT.getKey());
            this.add(MktCouponStateEnum.NO_USE.getKey());
         }
      };
   }

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

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

}
