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

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

public enum SubjectiveStatus {

    UNMARK("未评完"), MARKED("已评完");

    private String name;

    private static List<SubjectiveStatus> options;

    private SubjectiveStatus(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static SubjectiveStatus findByText(String text) {
        for (SubjectiveStatus c : SubjectiveStatus.values()) {
            if (c.toString().equalsIgnoreCase(text)) {
                return c;
            }
        }
        return null;
    }

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