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

import java.util.Objects;

/**
 * @Description: 发布状态enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/3/29
 */
public enum PublishStatusEnum {

    UN_COMPUTE("未计算"),

    WILL_COMPUTE("待计算"),

    COMPUTING("计算中"),

    UN_PUBLISH("未发布"),

    PUBLISH("已发布");

    private String title;

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

    public String getTitle() {
        return title;
    }

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