package com.mvc.constant;

/**
 * 设备状态(投运管理)处理状态
 */
public enum DeviceOperationProcessingStatus {
    UNHANDLED(0, "未处理"),
    OPERATIONAL(1, "已投运"),
    IGNORED(2, "已忽略"),
    OBSOLETE(3, "已过时");

    private int flag;
    private String desc;

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

    public int getFlag() {
        return flag;
    }

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

    public String getDesc() {
        return desc;
    }

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

    public static DeviceOperationProcessingStatus findDeviceOperationProcessingStatusByflag(int flag) {
        for (DeviceOperationProcessingStatus state : DeviceOperationProcessingStatus.values()) {
            if (state.flag == flag) {
                return state;
            }
        }
        return null;
    }
}
