package com.qmth.distributed.print.business.enums;

import java.util.Objects;

/**
 * @Description: 题卡status enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/4/9
 */
public enum ExamCardStatusEnum {

    STAGE("暂存"),

    SUBMIT("提交");

    private String title;

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

    public String getTitle() {
        return title;
    }

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