package net.northking.cctp.element.desktop.enums;

import com.alibaba.fastjson.JSON;
import net.northking.cctp.element.core.type.EnumClass;

import java.util.*;

/**
 * <p>Title: ActionEnum</p>
 * <p>Description: </p>
 *
 * @Author chenjianfeng
 * @Version V1.0
 * @Date 2022/11/08
 * <p>Copyright: NorthKing@RPA（C）2020 版权</p>
 */

public enum ActionEnum implements EnumClass {
    /**
     * check
     */
    check("Check", 1),
    /**
     * uncheck
     */
    uncheck("Uncheck", 2),
    /**
     * toggle
     */
    toggle("Toggle", 3);

    private String key;

    private Integer value;

    ActionEnum(String key, Integer value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getEnumData() {
        List<Map<String, Object>> result = new ArrayList<>();
        for (ActionEnum nullEnum : EnumSet.allOf(ActionEnum.class)) {
            Map<String, Object> one = new HashMap();
            one.put("label", nullEnum.key);
            one.put("value", nullEnum.value);
            result.add(one);
        }
        return JSON.toJSONString(result);
    }
}