SRC - Source typeDST - Destination typepublic class TypeConverterRuleFixedSourceAssignableDestination<SRC,DST> extends AbstractTypeConverterRule<SRC,DST>
ITypeConverterRule.ESubType| Constructor and Description |
|---|
TypeConverterRuleFixedSourceAssignableDestination(Class<SRC> aSrcClass,
Class<DST> aDstClass,
Function<SRC,DST> aConverter) |
| Modifier and Type | Method and Description |
|---|---|
DST |
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.
|
Class<DST> |
getDestinationClass() |
Class<SRC> |
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.@Nullable public DST 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,DST>Copyright © 2014–2016 Philip Helger. All rights reserved.