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

public enum ClickTypeEnum implements EnumClass {
    /**
     * single
     */
    single("单击", 1),
    /**
     * double
     */
    Double("双击", 2),
    /**
     * down
     */
    down("向下", 3),
    /**
     * up
     */
    up("向上", 4);

    private String key;

    private Integer value;

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

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