package com.persagy.dmp.file.constant;

import lombok.Getter;
/***
 * Description: 文件迁移服务
 * @author : lijie
 * Update By 2021/12/13 15:08
 */
@Getter
public enum FileMigrateEnum {

    /** HDFS_TO_MINIO */
    HDFS_TO_MINIO("0", "hdfsToMinioServiceImpl"),
    /** IMAGE_URL_TO_MINIO */
    IMAGE_URL_TO_MINIO("1", "imageUrlToMinioServiceImpl"),
    /** HDFS */
    IMAGE_URL_TO_IMAGE_URL("2", "imageUrlToImageUrlServiceImpl");

    private String index;
    private String name;

    FileMigrateEnum(String index, String name) {
        this.index = index;
        this.name = name;
    }

    /**
     * 获取Enum
     * @param index
     * @return
     */
    public static FileMigrateEnum load(String index) {
        for (FileMigrateEnum value: values()) {
            if (value.getIndex().equals(index)) {
                return value;
            }
        }
        return null;
    }


}
