Class MinifyProductDetailsContributor

java.lang.Object
com.broadleafcommerce.catalog.service.product.commerce.contributor.MinifyProductDetailsContributor
All Implemented Interfaces:
ProductDetailsContributor, org.springframework.core.Ordered

public class MinifyProductDetailsContributor extends Object implements ProductDetailsContributor
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
  • 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 supplied ProductDetails. This should not mutate the inputted details, but return a new one with the new contributions.
      Specified by:
      contribute in interface ProductDetailsContributor
      Parameters:
      productDetailsList - The details to which to contribute
      productDetailsContexts - 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 interface org.springframework.core.Ordered
    • minify

      protected void minify(ProductDetails details)