Interface ConverterManager
- All Known Implementing Classes:
DefaultConverterManager
public interface ConverterManager
Handle all registered converters.
-
Method Summary
Modifier and TypeMethodDescriptionintcount()Returns the number of registered converters.<S,T> TypeConverter<S, T> getConverter(Class<S> sourceClassType, Class<T> targetClassType) Returns whether the Manager have converter for the given input / output type.<S,T> boolean hasConvertFor(Class<S> sourceClassType, Class<T> targetClassType) Returns whether the Manager have converter for the given input / output type.voidregisterConverter(Class<?> sourceClassType, Class<?> targetClassType, TypeConverter<?, ?> converter) Register converter.
-
Method Details
-
hasConvertFor
Returns whether the Manager have converter for the given input / output type.- Type Parameters:
S- The source generic typeT- The target generic type- Parameters:
sourceClassType- The source type classtargetClassType- The target type class- Returns:
trueif the manager has a matching converter, otherwisefalse
-
registerConverter
void registerConverter(Class<?> sourceClassType, Class<?> targetClassType, TypeConverter<?, ?> converter) Register converter.- Parameters:
sourceClassType- The source type classtargetClassType- The target type classconverter- The converter
-
getConverter
Returns whether the Manager have converter for the given input / output type.- Type Parameters:
S- The source generic typeT- The target generic type- Parameters:
sourceClassType- The source type classtargetClassType- The target type class- Returns:
- The requested converter
-
count
int count()Returns the number of registered converters.- Returns:
- The number of registered converters
-