package net.northking.cctp.dataPool.enums;

public enum DataHeaderType {
    STRING("0","string"),
    MAP("1","keyValue"),
    BOOLEAN("2","boolean"),
    ARRAY("3","array"),
    JSON("4","json"),
    XML("5","xml"),
    HTML("6","html");

    private String code;
    private String name;
    DataHeaderType(String code, String name){
        this.code = code;
        this.name = name;
    }
    public static String getName(String code){
        for (DataHeaderType value : DataHeaderType.values()) {
            if (code.equals(value.code)) {
                return value.name;
            }
        }
        return "";
    }

    public static String getCode(String name){
        for (DataHeaderType value : DataHeaderType.values()) {
            if (name.equals(value.name)) {
                return value.code;
            }
        }
        return "";
    }
}
