package com.yunfeiyun.agmp.common.enums;

/**
 * 农机具状态
 * @author liuyaowen
 * */
public enum MachStatus {
    UNUSED("1", "空闲中"),
    USED("2", "使用中")
    ;
    private final String code;
    private final String message;

    MachStatus(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(MachStatus taskStatus: MachStatus.values()) {
            if(taskStatus.equal(code)){
                return taskStatus.getMessage();
            }
        }
        return "";
    }

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