package com.bonus.canteen.core.order.common.constants;

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

public enum OrderRefundStateEnum {
   UN_APPLY(1, "未申请"),
   FINISH(2, "已退单"),
   PART_SUCC(3, "部分退单");

   private final Integer key;
   private final String desc;

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

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

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

      return "";
   }

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

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

      return list;
   }

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

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

   // $FF: synthetic method
   private static OrderRefundStateEnum[] $values() {
      return new OrderRefundStateEnum[]{UN_APPLY, FINISH, PART_SUCC};
   }
}
