package com.qmth.teachcloud.mark.enums;

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

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

    private String name;

    private int value;

    private static List<MarkTaskStatus> options;

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

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

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

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

}
