Class DefaultPayloadAttributeValueConverter
java.lang.Object
de.hybris.platform.odata2services.converter.DefaultPayloadAttributeValueConverter
- All Implemented Interfaces:
PayloadAttributeValueConverter
public class DefaultPayloadAttributeValueConverter
extends Object
implements PayloadAttributeValueConverter
Default implementation of the ODataEntry attribute value converter, which handles different kinds of attribute values,
e.g. a map, a collection, an ODataFeed, etc by delegating to the registered
ValueConverters.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertAttributeValue(ConversionParameters parameters) Converts an ODataEntry attribute value to values acceptable byIntegrationItem.voidsetValueConverters(@NotNull List<ValueConverter> converters) Injects a list of value converters that will handle different kinds of possible ODataEntry attribute values.
-
Constructor Details
-
DefaultPayloadAttributeValueConverter
public DefaultPayloadAttributeValueConverter()
-
-
Method Details
-
convertAttributeValue
Description copied from interface:PayloadAttributeValueConverterConverts an ODataEntry attribute value to values acceptable byIntegrationItem.- Specified by:
convertAttributeValuein interfacePayloadAttributeValueConverter- Parameters:
parameters- context for the value conversion, which carries attribute name, value, ODataContext, etc. For that reason the conversion parameters cannot benullor otherwise conversion is not possible.- Returns:
- converted value that is OData independent and can be used as attribute value in
IntegrationItem. This value may benullbecause attributes may havenullvalues.
-
setValueConverters
Injects a list of value converters that will handle different kinds of possible ODataEntry attribute values. Calling this method subsequently with different lists of converters, resets the previously set converters and keeps only converters of the last call.- Parameters:
converters- a list of converters in the order of how they will be applied for the value conversion. Ideally the converters should be mutually exclusive and only one converter should be responsible for conversion of a givenConversionParameters. If it's not so, keep in mind that order of the converters is important because once a converter for handling the attribute value is found no other converters will be even assessed.- See Also:
-