package com.bonus.canteen.core.common.enums;

import cn.hutool.core.collection.ListUtil;

import java.util.List;

//public enum AllocMealtimeTypeEnum implements LeExcelFieldEnum<AllocMealtimeTypeEnum> {
public enum AllocMealtimeTypeEnum {
   MEALTIME_BREAKFAST(1, "早餐"),
   MEALTIME_LUNCH(2, "午餐"),
   MEALTIME_AFTERNOON_TEA(3, "下午茶"),
   MEALTIME_DINNER(4, "晚餐"),
   MEALTIME_MIDNIGHT_SNACK(5, "夜宵");

   private final Integer key;
   private final String desc;

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

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

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

      return null;
   }

   public static String getDescByKey(Integer key) {
      AllocMealtimeTypeEnum[] enums = values();
      AllocMealtimeTypeEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         AllocMealtimeTypeEnum anEnum = var2[var4];
         if (anEnum.getKey().equals(key)) {
            return anEnum.getDesc();
         }
      }

      return "";
   }

   public static Integer getKeyByDesc(String desc) {
      AllocMealtimeTypeEnum[] enums = values();
      AllocMealtimeTypeEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         AllocMealtimeTypeEnum anEnum = var2[var4];
         if (anEnum.getDesc().equals(desc)) {
            return anEnum.getKey();
         }
      }

      return null;
   }

   public static List<Integer> allTypeList() {
      return ListUtil.toList(new Integer[]{MEALTIME_BREAKFAST.getKey(), MEALTIME_LUNCH.getKey(), MEALTIME_AFTERNOON_TEA.getKey(), MEALTIME_DINNER.getKey(), MEALTIME_MIDNIGHT_SNACK.getKey()});
   }

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

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

   // $FF: synthetic method
   private static AllocMealtimeTypeEnum[] $values() {
      return new AllocMealtimeTypeEnum[]{MEALTIME_BREAKFAST, MEALTIME_LUNCH, MEALTIME_AFTERNOON_TEA, MEALTIME_DINNER, MEALTIME_MIDNIGHT_SNACK};
   }
//
//   public static class ExcelConvertor extends LeExcelFieldConvertor<AllocMealtimeTypeEnum> {
//      public ExcelConvertor() {
//         super(AllocMealtimeTypeEnum.class);
//      }
//   }
}
