package com.qmth.exam.reserve.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Description 异步任务执行状态
 */
@Getter
@AllArgsConstructor
public enum AsyncTaskStatus {

    INIT("初始化"),

    RUNNING("进行中"),

    FINISH("已完成");

    private final String title;

    public static String convertToName(String title) {
        for (AsyncTaskStatus e : AsyncTaskStatus.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
