Class ProductConsolidationUtil
java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.util.ProductConsolidationUtil
Provides utility support for operations performed throughout Product Consolidation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getSandboxOwner
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState context) Get the sandbox owner for the context based on field changes if in a user sandbox context.static <T extends com.broadleafcommerce.data.tracking.core.ContextStateAware>
booleanisDeleted
(T entity) Check if the entity is deleted in its context.static boolean
isInheriting
(String reference, String candidate, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines) Determine if the candidate catalog id represents a catalog that inherits from a catalog represented by the reference catalog id.
-
Method Details
-
getSandboxOwner
public static String getSandboxOwner(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState context) Get the sandbox owner for the context based on field changes if in a user sandbox context.- Parameters:
context
- context information surrounding sandboxing/multitenant state- Returns:
- sandbox owner of current context if in user context
-
isDeleted
public static <T extends com.broadleafcommerce.data.tracking.core.ContextStateAware> boolean isDeleted(T entity) Check if the entity is deleted in its context.- Type Parameters:
T
- the type of the entity- Parameters:
entity
- the entity which represents an override in its context- Returns:
- whether or not the entity has been deleted in its context
-
isInheriting
public static boolean isInheriting(String reference, String candidate, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines) Determine if the candidate catalog id represents a catalog that inherits from a catalog represented by the reference catalog id.- Parameters:
reference
- The id of the reference catalogcandidate
- The id of the candidate cataloginheritanceLines
- the catalog inheritance lines top-down- Returns:
- Whether or not the candidate inherits from the reference
-