Package org.apache.ofbiz.base.conversion
Class Converters.PassThruConverter<S,T>
java.lang.Object
org.apache.ofbiz.base.conversion.Converters.PassThruConverter<S,T>
- All Implemented Interfaces:
Converter<S,
T>
- Enclosing class:
- Converters
Pass thru converter used when the source and target java object
types are the same. The
convert
method returns the
source object.-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class<?> sourceClass, Class<?> targetClass) Returnstrue
if this object can convertsourceClass
totargetClass
.Convertsobj
toT
.Convertsobj
toT
.Class<?>
Returns the sourceClass
for this converter.Class<?>
Returns the targetClass
for this converter.
-
Method Details
-
canConvert
Description copied from interface:Converter
Returnstrue
if this object can convertsourceClass
totargetClass
.Implementations can accomodate class hierarchy ranges by converting super classes or interfaces.
- Specified by:
canConvert
in interfaceConverter<S,
T> - Parameters:
sourceClass
- The sourceClass
targetClass
- The targetClass
- Returns:
true
if this object can convertsourceClass
totargetClass
.
-
convert
Description copied from interface:Converter
Convertsobj
toT
.- Specified by:
convert
in interfaceConverter<S,
T> - Parameters:
obj
- The sourceObject
to convert- Returns:
- The converted
Object
- Throws:
ConversionException
-
convert
Description copied from interface:Converter
Convertsobj
toT
.- Specified by:
convert
in interfaceConverter<S,
T> - Parameters:
targetClass
- TheClass
to convert toobj
- The sourceObject
to convert- Returns:
- The converted
Object
- Throws:
ConversionException
-
getSourceClass
Description copied from interface:Converter
Returns the sourceClass
for this converter.- Specified by:
getSourceClass
in interfaceConverter<S,
T> - Returns:
- The source
Class
for this converter
-
getTargetClass
Description copied from interface:Converter
Returns the targetClass
for this converter.- Specified by:
getTargetClass
in interfaceConverter<S,
T> - Returns:
- The target
Class
for this converter
-