package com.njcn.device.pq.enums;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum RunFlagEnum {

    /**
     * 运行状态枚举
     */
    RUNNING(0, "运行"),
    OVERHAUL(1, "检修"),
    OFF_LINE(2, "停运"),
    DEBUG(3, "调试"),
    QUIT(4, "退运");

    private final Integer status;
    private final String remark;

    RunFlagEnum(Integer status, String remark) {
        this.status = status;
        this.remark = remark;
    }

    public static String getRunFlagRemarkByStatus(Integer status) {
        RunFlagEnum runFlagEnum = Arrays.stream(RunFlagEnum.values())
                .filter(runFlagEnum1 -> runFlagEnum1.getStatus().equals(status))
                .findAny()
                .orElse(RUNNING);
        return runFlagEnum.getRemark();
    }
}
