package com.yeejoin.amos.boot.module.jxiop.biz.Enum;

import com.yeejoin.amos.boot.module.jxiop.api.Enum.AlarmDesc;

public enum WarningNameEnum {
    ANQUAN(0,"安全"),
    ZHUYI(1,"注意"),
    JINGGAO(2, "警告"),
    WEIXIAN(3,"危险");

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

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

    public String getName() {
        return name;
    }

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

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

    public static int getCode(String name) {

        for (WarningNameEnum warningNameEnum : WarningNameEnum.values())
        {
            if (warningNameEnum.getName().equals(name))
            {
                return warningNameEnum.getCode();
            }
        }
        return 0;
    }


}
