Class GenericConverter<SOURCE,TARGET>
java.lang.Object
de.hybris.platform.servicelayer.dto.converter.GenericConverter<SOURCE,TARGET>
- All Implemented Interfaces:
Converter<SOURCE,,TARGET> org.springframework.core.convert.converter.Converter<SOURCE,TARGET>
Converts all properties from source to target that have the same name and have compatible types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new type of targetClass and converts all properties from source to this new instance that have the same name and have compatible types.Converts all properties from source to target that have the same name and have compatible types.protected TARGETvoidsetDestClass(Class<TARGET> destClass) The class of the target.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convertAll, convertAllIgnoreExceptions, getLoggerMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
GenericConverter
public GenericConverter()
-
-
Method Details
-
convert
Creates a new type of targetClass and converts all properties from source to this new instance that have the same name and have compatible types. -
convert
Converts all properties from source to target that have the same name and have compatible types.- Specified by:
convertin interfaceConverter<SOURCE,TARGET> - Parameters:
source- the source objectprototype- the prototype to fill- Returns:
- the converted object, identical to the prototype
- Throws:
ConversionException- if an error occurs
-
setDestClass
The class of the target. Used byconvert(Object).- Parameters:
destClass-
-
createDestObject
- Throws:
ConversionException
-