package com.qmth.teachcloud.common.enums.mark;

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

public enum MarkProblemStatus {

    WAITING("待处理", 0), BACK("已打回", 2);

    private String name;

    private int value;

    private static List<MarkProblemStatus> options;

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

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

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

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