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
public abstract class CollectionValueConverter extends AbstractValueConverter
A base class forCollectionvalue converters.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCollectionValueConverter(@NotNull ODataEntryToIntegrationItemConverter entryConverter, @NotNull PayloadAttributeValueConverter valueConverter)A constructor injecting dependencies for reuse.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectconvert(ConversionParameters parameters)Converts ODataEntry attribute value to the value that can exist inside anIntegrationItem.protected abstract java.util.CollectiongetAttributeValue(java.lang.Object value)Presents attribute value, that is conceptually a collection but may not be presented so in the ODataEntry, as aCollectionprotected java.lang.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, toValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.odata2services.converter.ValueConverter
isApplicable
-
-
-
-
Constructor Detail
-
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 Detail
-
getAttributeValue
protected abstract java.util.Collection getAttributeValue(java.lang.Object value)
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
public java.lang.Object convert(ConversionParameters parameters)
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
protected java.lang.Object handleCollection(ConversionParameters parameters)
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
protected LocalizedAttributes handleLocalizedAttributes(ConversionParameters parameters)
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.
-
-