package com.mvc.constant;

import com.mvc.netty.dealconstant.MsgIdentifier;
import org.thymeleaf.standard.inline.StandardCSSInliner;

public enum DeviceState {
    Dengji("1","登记台账"),
    Kaoji("2","测试"),
    Ruku("3","入库"),
    Chuku("4","出库"),
    Guzhang("5","故障"),
    Xiufu("6","修复"),
    Jiechu("7","借出"),
    Guihuan("8","归还"),
    Baofei("9","报废")
    ;

    private String flag;
    private String desc;

    DeviceState(String flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static  DeviceState findDeviceStateByflag(String flag){
        for (DeviceState state: DeviceState.values()) {
            if (state.flag.equals(flag)) {
                return  state;
            }
        }
        return null;
    }

}
