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

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

import java.util.*;

public enum VerificationTypeEnum implements EnumClass {
    /**
     * NONE
     */
    NUMBER("NUMBER", 1),
    /**
     * INTERACTIVE
     */
    NUMBERANDWORD("NUMBERANDWORD", 2),;

    private String key;

    private Integer value;

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

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