Class CollectionValueConverter
java.lang.Object
de.hybris.platform.odata2services.converter.AbstractValueConverter
de.hybris.platform.odata2services.converter.CollectionValueConverter
- All Implemented Interfaces:
ValueConverter
- Direct Known Subclasses:
ODataCollectionValueConverter,ODataFeedValueConverter,ReplaceAttributeCollectionValueConverter
A base class for
Collection value converters.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCollectionValueConverter(@NotNull ODataEntryToIntegrationItemConverter entryConverter, @NotNull PayloadAttributeValueConverter valueConverter) A constructor injecting dependencies for reuse. -
Method Summary
Modifier and TypeMethodDescriptionconvert(ConversionParameters parameters) Converts ODataEntry attribute value to the value that can exist inside anIntegrationItem.protected abstract CollectiongetAttributeValue(Object value) Presents attribute value, that is conceptually a collection but may not be presented so in the ODataEntry, as aCollectionprotected ObjecthandleCollection(ConversionParameters parameters) Converts a "classic" collection value, where the collection in EDMX corresponds to a collection in the type system.protected LocalizedAttributeshandleLocalizedAttributes(ConversionParameters parameters) Converts a collection of Localized___xxx entities representing localized attribute in the type system.Methods inherited from class de.hybris.platform.odata2services.converter.AbstractValueConverter
toIntegrationItem, toValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.odata2services.converter.ValueConverter
isApplicable
-
Constructor Details
-
CollectionValueConverter
protected CollectionValueConverter(@NotNull @NotNull ODataEntryToIntegrationItemConverter entryConverter, @NotNull @NotNull PayloadAttributeValueConverter valueConverter) A constructor injecting dependencies for reuse.- Parameters:
entryConverter- an instance ofODataEntryToIntegrationItemConverterto use.valueConverter- an instance ofPayloadAttributeValueConverterto use.
-
-
Method Details
-
getAttributeValue
Presents attribute value, that is conceptually a collection but may not be presented so in the ODataEntry, as aCollection- Parameters:
value- a value that represents a collection of elements but may not implement one of the JavaCollectioninterfaces.- Returns:
- same value presented as a Java
Collection
-
convert
Description copied from interface:ValueConverterConverts ODataEntry attribute value to the value that can exist inside anIntegrationItem. In a typical usecase, whenValueConverter.isApplicable(ConversionParameters)returnstrue, only then call this method.- Parameters:
parameters- conversion context containing the attribute value and other context information. This should be sameConversionParameters, which were passedValueConverter.isApplicable(ConversionParameters)- Returns:
- converted value.
-
handleCollection
Converts a "classic" collection value, where the collection in EDMX corresponds to a collection in the type system.- Parameters:
parameters- context parameters for the conversion, whereConversionParameters.getAttributeValue()returns an instance ofCollection- Returns:
- a collection, in which each element is converted from the elements of
ConversionParameters.getAttributeValue()collection.
-
handleLocalizedAttributes
Converts a collection of Localized___xxx entities representing localized attribute in the type system.- Parameters:
parameters- a collection of localized values, in which each element is an ODataEntry of Localized___xxx type.- Returns:
- localized attribute values.
-