Class MinifyProductDetailsContributor
java.lang.Object
com.broadleafcommerce.catalog.service.product.commerce.contributor.MinifyProductDetailsContributor
- All Implemented Interfaces:
ProductDetailsContributor
,org.springframework.core.Ordered
Strip out (or transform) information for a product details request before passing back to the
caller. This is useful for reducing the overall JSON footprint for the details, especially in the
case of unused information. This contributor should normally be last in the list.
- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<D extends ProductDetails,
C extends ProductDetailsContext>
Collection<D>contribute
(Collection<D> productDetailsList, Collection<C> productDetailsContexts, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedProductDetails
.int
getOrder()
protected void
minify
(ProductDetails details)
-
Constructor Details
-
MinifyProductDetailsContributor
public MinifyProductDetailsContributor()
-
-
Method Details
-
contribute
public <D extends ProductDetails,C extends ProductDetailsContext> Collection<D> contribute(Collection<D> productDetailsList, Collection<C> productDetailsContexts, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ProductDetailsContributor
Contributes to the suppliedProductDetails
. This should not mutate the inputted details, but return a new one with the new contributions.- Specified by:
contribute
in interfaceProductDetailsContributor
- Parameters:
productDetailsList
- The details to which to contributeproductDetailsContexts
- The context containing information that may be important for contributors such as active price lists.contextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- An version of the supplied
ProductDetails
with the new contributions.
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
minify
-