package com.gyee.alarm.model.vo;

public enum AlarmCustomType {

    WT("windturbine", "设备自定义报警"),
    WP("station", "场站自定义报警");

    private String code;
    private String name;

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

    AlarmCustomType(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 (AlarmCustomType ele : values()) {
            if (ele.getCode().equals(code)) {
                return ele.getName();
            }
        }
        return null;
    }


}
