package com.qmth.teachcloud.report.business.enums;

import java.util.Objects;

/**
 * @Description: 学期enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/7
 */
public enum SemesterEnum {

    FIRST("2020-2021学年度第1学期"),

    SECOND("2020-2021学年度第2学期");

    private String title;

    private SemesterEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param title
     * @return
     */
    public static String convertToName(String title) {
        for (SemesterEnum e : SemesterEnum.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
