package cn.com.qmth.stmms.common.enums;

import java.util.LinkedList;
import java.util.List;

public enum SelectiveStatus {
    UN_SELECTIVE("未选做", 0), MUTI_SELECTIVE("多选做", 1), LESS_SELECTIVE("少选做", 2);

    private String name;

    private int value;

    private static List<SelectiveStatus> options;

    private SelectiveStatus(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static SelectiveStatus findByValue(Integer value) {
        for (SelectiveStatus c : SelectiveStatus.values()) {
            if (c.getValue() == value) {
                return c;
            }
        }
        return null;
    }

    public static List<SelectiveStatus> getOptionList() {
        if (options == null) {
            options = new LinkedList<>();
            for (SelectiveStatus status : SelectiveStatus.values()) {
                options.add(status);
            }
        }
        return options;
    }

}
