Class VariantProductConsolidationContributor
java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor<Variant>
com.broadleafcommerce.catalog.service.product.consolidation.VariantProductConsolidationContributor
- All Implemented Interfaces:
ProductConsolidationContributor
public class VariantProductConsolidationContributor
extends ContextualProductConsolidationContributor<Variant>
Consolidates
Variant
s into products.-
Field Summary
Fields inherited from class com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor
IGNORE_ARCHIVED_FILTER, typeFactory
-
Constructor Summary
ConstructorDescriptionVariantProductConsolidationContributor
(VariantService<Variant> variantSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetObjectsToConsolidate
(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieve the full list of domain objects of this type to be consolidated into the products.protected VariantService<Variant>
idGetter()
Defines the function which retrieves the contextId of the domain object in order to recognize it in different contexts.Defines the function which retrieves the Product ID from the domain object to consolidate, in order to group it with the appropriate product for processing.protected BiConsumer<ConsolidatedProduct,
List<Variant>> setter()
Defines the function which should be used to set the domain objects on the consolidated product.boolean
shouldConsolidate
(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Determines whether this contributor should be executed based on the given parameters and context.Methods inherited from class com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor
consolidateProducts, consolidateRelations, contextCompositeKey, contextCompositeKey, contextStatesMatch, createOverrideProductForContext, findImplicitMatches, getCloneMapper, getInheritanceLevel, getMostSpecificCatalogId, getProductConsolidationRequest, getRsqlParser, getTypeFactory, ignoreArchived, isInheriting, setListValue, setSingleValue
-
Constructor Details
-
VariantProductConsolidationContributor
public VariantProductConsolidationContributor(VariantService<Variant> variantSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
shouldConsolidate
public boolean shouldConsolidate(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ProductConsolidationContributor
Determines whether this contributor should be executed based on the given parameters and context.Returns true by default.
- Parameters:
productIds
- the IDs of the products to consolidateproducts
- the product in all explicit context statesinheritanceLines
- the catalog inheritance lines top-down from all of the productscontext
- context information surrounding sandboxing/multitenant state
-
getObjectsToConsolidate
protected List<Variant> getObjectsToConsolidate(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from class:ContextualProductConsolidationContributor
Retrieve the full list of domain objects of this type to be consolidated into the products.- Specified by:
getObjectsToConsolidate
in classContextualProductConsolidationContributor<Variant>
- Parameters:
productIds
- the IDs of the products to consolidateproducts
- the products in all explicit context statesinheritanceLines
- the catalog inheritance lines top-down from all of the productscontext
- context information surrounding sandboxing/multitenant state- Returns:
- all domain objects of this type to consolidate into the products
-
setter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which should be used to set the domain objects on the consolidated product.- Specified by:
setter
in classContextualProductConsolidationContributor<Variant>
- Returns:
- function to set domain objects on the consolidated product
-
productIdGetter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which retrieves the Product ID from the domain object to consolidate, in order to group it with the appropriate product for processing.- Specified by:
productIdGetter
in classContextualProductConsolidationContributor<Variant>
- Returns:
- function to retrieve Product ID of the domain object
-
idGetter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which retrieves the contextId of the domain object in order to recognize it in different contexts.- Specified by:
idGetter
in classContextualProductConsolidationContributor<Variant>
- Returns:
- function to retrieve contextId of the domain object
-
getVariantSvc
-