Interface DataToWsConverter<DATA,WSDTO>
-
- Type Parameters:
DATA- source typeWSDTO- target type
- All Known Implementing Classes:
AbstractDataToWsConverter,ComponentDataToWsConverter,MediaDataToWsConverter,NavigationNodeDataToWsConverter,PageDataToWsConverter,SlotDataToWsConverter
public interface DataToWsConverter<DATA,WSDTO>Interface to convert object of type A to object of type B using jaxb.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.function.Predicate<java.lang.Object>canConvert()Predicate to verify whether the convert method can be used or not.WSDTOconvert(DATA source, java.lang.String fields)Method to convert a source object to a target object.voidcustomize(ma.glasnost.orika.MapperFactory factory)Method to customize conversion between source and target object.java.lang.ClassgetDataClass()Class that represents a source objectjava.lang.ClassgetWsClass()Class that represents a target object
-
-
-
Method Detail
-
getDataClass
java.lang.Class getDataClass()
Class that represents a source object- Returns:
- the
Class
-
getWsClass
java.lang.Class getWsClass()
Class that represents a target object- Returns:
- the
Class
-
canConvert
java.util.function.Predicate<java.lang.Object> canConvert()
Predicate to verify whether the convert method can be used or not.- Returns:
TRUEwhen {convert(Object, String)can be performed;FALSEotherwise.
-
convert
WSDTO convert(DATA source, java.lang.String fields)
Method to convert a source object to a target object.- Parameters:
source- the source objectfields- the fields that should be populated in target object- Returns:
- the target object
-
customize
void customize(ma.glasnost.orika.MapperFactory factory)
Method to customize conversion between source and target object. This method is called after the basic conversion is finished.- Parameters:
factory- theMapperFactorythat can be used to add new customization.
-
-