package com.yunfeiyun.agmp.common.enums;

/**
 * 预警状态
 * @author liuyaowen
 * */
public enum WarnStatus {
    PENDING("1", "待处理"),
    READ("2", "已知晓"),
    DISTRIBUTE("3", "下发")
    ;
    private final String code;
    private final String message;

    WarnStatus(String code, String message)
    {
        this.code = code;
        this.message = message;
    }

    public String getCode()
    {
        return code;
    }

    public String getMessage()
    {
        return message;
    }

    public static String valueOfCode(String code){
        for(WarnStatus taskStatus: WarnStatus.values()) {
            if(taskStatus.equal(code)){
                return taskStatus.getMessage();
            }
        }
        return "";
    }

    public boolean equal(String code){
        return this.code.equals(code);
    }
}
