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: OffsetValueEnum</p>
 * <p>Description: </p>
 *
 * @Author chenjianfeng
 * @Version V1.0
 * @Date 2023/01/30
 * <p>Copyright (c) 京北方信息技术股份有限公司 Corporation 2022 . All rights reserved.</p>
 */

public enum OffsetValueEnum implements EnumClass {
    /**
     * twentyFive
     */
    twentyFive("25%", "0.25"),
    /**
     * fifty
     */
    fifty("50%", "0.5"),
    /**
     * seventyFive
     */
    seventyFive("75%", "0.75"),
    /**
     * oneHundred
     */
    oneHundred("100%", "1.0");

    private String key;

    private String value;

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

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