Package com.helger.commons.typeconvert
Interface ITypeConverterRule<SRC,DST>
- Type Parameters:
SRC- source typeDST- destination type
- All Superinterfaces:
Function<SRC,,DST> ITypeConverter<SRC,DST>
- All Known Implementing Classes:
AbstractTypeConverterRule,TypeConverterRuleAnySourceFixedDestination,TypeConverterRuleAssignableSourceFixedDestination,TypeConverterRuleFixedSourceAnyDestination,TypeConverterRuleFixedSourceAssignableDestination
Flexible type converter that can handle multiple source and/or destination
classes.
- Author:
- Philip Helger
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefine the sub types of the rules. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class<?> aSrcClass, Class<?> aDstClass) Check if this converter can handle the conversion from the passed source to the passed destination class.Methods inherited from interface com.helger.commons.typeconvert.ITypeConverter
apply
-
Method Details
-
getSubType
- Returns:
- The sub type of the converter rule. May not be
null.
-
canConvert
Check if this converter can handle the conversion from the passed source to the passed destination class. Note: as this method is called for every type conversion for which no exact converters are present, the implementation of this method should be as efficient as possible.- Parameters:
aSrcClass- Source class to convert from. Nevernull.aDstClass- Destination class to convert to. Nevernull.- Returns:
trueif conversion is possible,falseotherwise.
-