All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.feizns.convert.Converter Maven / Gradle / Ivy

Go to download

Java 类型,反射,属性以及实体类操作工具类。

There is a newer version: 5.5-RELEASE
Show newest version
package com.gitee.feizns.convert;

import lombok.NonNull;

/**
 * 类型转换
 * @author feizns
 * @since 2019/5/19 0019
 */
@FunctionalInterface
public interface Converter {

    /**
     *
     * @param original
     * @param targetType
     * @return
     */
    R to(@NonNull T original, Class targetType);

    /**
     * 转换器的优先级,越低越优先
     * @return
     */
    default int priority() {
        return 0;
    }

    /**
     * 是否支持
     * @param targetType
     * @return
     */
    default boolean support(Class targetType) {
        return true;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy