Package org.javalite.conversion
Class ConverterAdapter<S,T>
java.lang.Object
org.javalite.conversion.ConverterAdapter<S,T>
- Type Parameters:
S
- Source typeT
- Destination type
- All Implemented Interfaces:
Converter<S,T>
- Direct Known Subclasses:
StringToSqlDateConverter
,StringToTimestampConverter
Converts instances of S to T.
- Author:
- Eric Nielsen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert(Class aSourceClass, Class aDestinationClass)
Returns true if this converter can convert instances of sourceClass to destinationClass.Converts instance of S to T.protected abstract T
Converts instance of S to T.
-
Constructor Details
-
ConverterAdapter
public ConverterAdapter()
-
-
Method Details
-
canConvert
Description copied from interface:Converter
Returns true if this converter can convert instances of sourceClass to destinationClass.- Specified by:
canConvert
in interfaceConverter<S,T>
- Parameters:
aSourceClass
- source ClassaDestinationClass
- destination Class- Returns:
- true if this converter can convert instances of sourceClass to destinationClass, false otherwise
-
sourceClass
-
destinationClass
-
convert
Description copied from interface:Converter
Converts instance of S to T. -
doConvert
Converts instance of S to T.- Parameters:
source
- instance of S, can be null- Returns:
- instance of S converted to type T
- Throws:
Exception
-