package com.qmth.sop.common.enums;

import java.util.Objects;

/**
 * @Description: 下载文件enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/4/6
 */
public enum DownloadFileEnum {

    IMPORT_FILE("导入文件"),

    REPORT_FILE("任务报告文件"),

    EXPORT_FILE("导出文件");

    private String title;

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

    public String getTitle() {
        return title;
    }

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