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

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

public enum GraduateType {

    NONE("不区分", 0), FRESH("应届", 1), FORMER("往届", 2);

    private String name;

    private int value;

    private static List<GraduateType> selectList;

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

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

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

    public static List<GraduateType> getSelectList() {
        if (selectList == null) {
            selectList = new LinkedList<GraduateType>();
            for (GraduateType graduateType : GraduateType.values()) {
                if (graduateType != NONE) {
                    selectList.add(graduateType);
                }
            }
        }
        return selectList;
    }
}
