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

public abstract class AbstractCollectionAttributePopulator extends AbstractAttributePopulator
  • 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 attribute
      context - 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: AbstractAttributePopulator
      Populates value of the specified item attribute.
      Specified by:
      populateAttribute in class AbstractAttributePopulator
      Parameters:
      item - item model to be populated.
      attribute - specifies, which attribute should be populated in the item.
      context - context information necessary to derive correct attribute value from the integration item.
    • getExistingCollection

      protected Collection<Object> getExistingCollection(ItemModel item, TypeAttributeDescriptor attr)
    • 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 combine
      existingValues - Existing values to combine
      descriptor - Describes the collection that stores the values
      Returns:
      A new collection containing the attribute values