DST - Destination typepublic class TypeConverterRuleAnySourceFixedDestination<DST> extends AbstractTypeConverterRule<Object,DST>
ITypeConverterRule.ESubType| Constructor and Description |
|---|
TypeConverterRuleAnySourceFixedDestination(Class<DST> aDstClass,
IFunction<? super Object,? extends DST> aConverter) |
| Modifier and Type | Method and Description |
|---|---|
DST |
apply(Object 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<?> |
getDestinationClass() |
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 Object 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<Object,DST>Copyright © 2014–2019 Philip Helger. All rights reserved.