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

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

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

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

    /**
     *
     * @param source
     * @return
     */
    R to(S source, Class targetType);

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

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy