package com.xjrsoft.common.enums;

public enum UseSemesterTypeEnum {
    /**
     * 周一
     */
    SEMESTER_ONE(1, "一学期"),

    /**
     * 周二
     */
    SEMESTER_TWO(2, "二学期"),
    /**
     * 周三
     */
    SEMESTER_THREE(3, "三学期"),
    /**
     * 周四
     */
    SEMESTER_FOUR(4, "四学期"),
    /**
     * 周五
     */
    SEMESTER_FIVE(5, "五学期"),
    /**
     * 周六
     */
    SEMESTER_SIX(6, "六学期");

    final int code;
    final String value;

    public int getCode() {
        return this.code;
    }

    public String getValue() {
        return this.value;
    }

    UseSemesterTypeEnum(final int code, final String message) {
        this.code = code;
        this.value = message;
    }

    public static int getCode(String value) {
        for (UseSemesterTypeEnum c : UseSemesterTypeEnum.values()) {
            if (c.getValue().equals(value)) {
                return c.getCode();
            }
        }
        return 0;
    }
}
