PiLotCountTypeEnum.java

package com.mycim.valueobject.consts;

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

/**
 * @author songpy
 * @version 1.0.0
 * @date 2021/8/18
 **/
public enum PiLotCountTypeEnum {
    /**
     * MES Lot Count
     */
    MES_LOT_COUNT("ByLotCountMES"),
    /**
     * MES Wafer Count
     */
    MES_WAFER_COUNT("ByWaferCountMES"),
    /**
     * EAP Lot Count
     */
    EAP_LOT_COUNT("ByLotCountEAPAuto"),
    /**
     * MES Wafer Count
     */
    EAP_WAFER_COUNT("ByWaferCountEAPAuto");

    private String desc;

    PiLotCountTypeEnum(String desc) {
        this.desc = desc;
    }

    public static List<Map<String, String>> toMapList() {
        List<Map<String, String>> list = new ArrayList<>();
        for (PiLotCountTypeEnum element : PiLotCountTypeEnum.values()) {
            Map<String, String> map = new HashMap<>();
            map.put("key", element.toString());
            map.put("value", element.getDesc());
            list.add(map);
        }
        return list;
    }

    public String getDesc() {
        return desc;
    }
}