SRC - Source typepublic class TypeConverterRuleFixedSourceAnyDestination<SRC> extends AbstractTypeConverterRule<SRC,Object>
ITypeConverterRule.ESubType| Constructor and Description |
|---|
TypeConverterRuleFixedSourceAnyDestination(Class<SRC> aSrcClass,
IFunction<? super SRC,? extends Object> aInBetweenConverter) |
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(SRC aSource)
Convert the passed source object to the destination type.
|
boolean |
canConvert(Class<?> aSrcClass,
Class<?> aDstClass)
Check if this converter can handle the conversion from the passed source to
the passed destination class.
|
protected Object |
getInBetweenValue(SRC aSource) |
Class<?> |
getSourceClass() |
String |
toString() |
getSubTypepublic final boolean canConvert(@Nonnull Class<?> aSrcClass, @Nonnull Class<?> aDstClass)
ITypeConverterRuleaSrcClass - Source class to convert from. Never null.aDstClass - Destination class to convert to. Never null.true if conversion is possible, false
otherwise.public final Object apply(@Nonnull SRC aSource)
ITypeConverteraSource - The source object to be converted. Cannot be null
because the type converter already filters null values!null.public String toString()
toString in class AbstractTypeConverterRule<SRC,Object>Copyright © 2014–2020 Philip Helger. All rights reserved.