package com.gyee.alarm.model.vo;

public enum AlarmTypeValue {

    BT("booststation", "升压站报警"),
    WT("windturbine", "设备报警"),
    CT("custom", "自定义报警");

    private String code;
    private String name;

    AlarmTypeValue(String code) {
        this.code = code;
    }

    AlarmTypeValue(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据code获取message
     *
     * @param code
     * @return
     */
    public static String getNmaeByCode(String code) {
        for (AlarmTypeValue ele : values()) {
            if (ele.getCode().equals(code)) {
                return ele.getName();
            }
        }
        return null;
    }


}
