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: InputModeEnum</p>
 * <p>Description: 点击模式</p>
 *
 * @Author chenjianfeng
 * @Version V1.0
 * @Date 2022/10/18
 * <p>Copyright: NorthKing@RPA（C）2020 版权</p>
 */

public enum InputModeEnum implements EnumClass {
    /**
     * default
     */
    Default("默认", 1),
    /**
     * sendMessage
     */
    sendMessage("发送信息", 2),
    /**
     * invokeMethod
     */
    invokeMethod("调用方法", 3);

    private String key;

    private Integer value;

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

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