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

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

    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;
    }

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

    public static int getCode(String name) {

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


}
