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

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

public enum DetailStateEnum {
   NORMAL(1, "未退菜"),
   REFUNDED(2, "已退菜"),
   PART_REFUND(3, "部分退菜");

   private final Integer key;
   private final String desc;

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

   public static boolean ifRefunded(Integer key) {
      return REFUNDED.getKey().equals(key);
   }

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

      for(int var4 = 0; var4 < var3; ++var4) {
         DetailStateEnum 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 DetailStateEnum[] $values() {
      return new DetailStateEnum[]{NORMAL, REFUNDED, PART_REFUND};
   }
}
