com.gitee.feizns.convert.Converter Maven / Gradle / Ivy
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 extends R> targetType);
/**
* 转换器的优先级,越低越优先
* @return
*/
default int priority() {
return 0;
}
/**
* 是否支持
* @param targetType
* @return
*/
default boolean support(Class> targetType) {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy