Class AbstractCollectionAttributePopulator

    • Constructor Detail

      • AbstractCollectionAttributePopulator

        public AbstractCollectionAttributePopulator()
    • Method Detail

      • getNewCollection

        protected abstract java.util.Collection<java.lang.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
      • combineAttributeValues

        protected java.util.Collection<java.lang.Object> combineAttributeValues​(java.util.Collection<java.lang.Object> newValues,
                                                                                java.util.Collection<java.lang.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