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

import java.util.Objects;

/**
 * @Description: 数据来源 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/9/9
 */
public enum DataSourceEnum {

    IMPORT("导入"),

    JOIN("关联查询的数据");

    private String title;

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

    public String getTitle() {
        return title;
    }

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