Class AbstractCollectionAttributePopulator
java.lang.Object
de.hybris.platform.inboundservices.persistence.populator.AbstractAttributePopulator
de.hybris.platform.inboundservices.persistence.populator.AbstractCollectionAttributePopulator
- All Implemented Interfaces:
AttributePopulator
- Direct Known Subclasses:
ItemModelCollectionAttributePopulator,ItemModelCollectionAttributePopulator,PrimitiveCollectionAttributePopulator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Object>combineAttributeValues(Collection<Object> newValues, Collection<Object> existingValues, CollectionDescriptor descriptor) Combines the existing and new values to formulate a new collection without duplicates.protected Collection<Object>getExistingCollection(ItemModel item, TypeAttributeDescriptor attr) protected abstract Collection<Object>getNewCollection(ItemModel item, TypeAttributeDescriptor attributeDescriptor, PersistenceContext context) Get the collection of values from the context to be persistedprotected voidpopulateAttribute(ItemModel item, TypeAttributeDescriptor attribute, PersistenceContext context) Populates value of the specified item attribute.Methods inherited from class de.hybris.platform.inboundservices.persistence.populator.AbstractAttributePopulator
getModelService, isApplicable, isNew, populate, setModelService
-
Constructor Details
-
AbstractCollectionAttributePopulator
public AbstractCollectionAttributePopulator()
-
-
Method Details
-
getNewCollection
protected abstract Collection<Object> getNewCollection(ItemModel item, TypeAttributeDescriptor attributeDescriptor, PersistenceContext context) Get the collection of values from the context to be persisted- Parameters:
attributeDescriptor- Contains information that describes the attributecontext- Contains the data to persist- Returns:
- Collection of values to persist
-
populateAttribute
protected void populateAttribute(ItemModel item, TypeAttributeDescriptor attribute, PersistenceContext context) Description copied from class:AbstractAttributePopulatorPopulates value of the specified item attribute.- Specified by:
populateAttributein classAbstractAttributePopulator- Parameters:
item- item model to be populated.attribute- specifies, which attribute should be populated in theitem.context- context information necessary to derive correct attribute value from the integration item.
-
getExistingCollection
-
combineAttributeValues
protected Collection<Object> combineAttributeValues(Collection<Object> newValues, Collection<Object> existingValues, CollectionDescriptor descriptor) Combines the existing and new values to formulate a new collection without duplicates. The default behavior is to append the new values to the collection. User can override this method to define a different strategy in combining the attribute values.- Parameters:
newValues- Update values to combineexistingValues- Existing values to combinedescriptor- Describes the collection that stores the values- Returns:
- A new collection containing the attribute values
-