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

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

public enum LibraryStatus {
    WAITING("未处理", 0), MARKED("已评", 1), REJECTED("已打回", 2), WAIT_ARBITRATE("等待仲裁", 3), ARBITRATED("已仲裁", 4), PROBLEM(
            "问题卷", 5), INSPECTED("已复核", 6);

    private String name;

    private int value;

    private static List<LibraryStatus> options;

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

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

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

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

}
