package com.sckw.excel.translate.enums;

/**
 *
 * 数据源枚举
 *
 *
 * @author lfdc
 * @version v1
 * @create 2020-12-01 11:18:37
 * @copyright
 */
public enum Source {

    TEST("com.sckw.excel.translate.context.Enums"),
    /**
     * 字典
     */
    DICTIONARY("context.Dictionary"),
    /**
     * 人员机构
     */
    ORGANIZATION("com.sckw.excel.translate.context.Organization"),
    /**
     * 枚举值
     */
    ENUMS("com.sckw.excel.translate.context.Enums");

    private String clazz;

    Source(String clazz) {
        this.clazz = clazz;
    }

    public String getClazz() {
        return clazz;
    }

    public static <T extends com.sckw.excel.translate.context.Source> Source valueOf(Class<T> clazz) {
        String clazzName = clazz.getName();
        if (clazzName.equals(DICTIONARY.getClazz())) {
            return DICTIONARY;
        }
        if (clazzName.equals(ORGANIZATION.getClazz())) {
            return ORGANIZATION;
        }
        if (clazzName.equals(ENUMS.getClazz())) {
            return ENUMS;
        }
//        if (clazzName.equals(TEST.getClazz())) {
//            return TEST;
//        }
        return null;
    }
}