Class ProductDetailsContext

java.lang.Object
com.broadleafcommerce.catalog.domain.product.commerce.ProductDetailsContext
All Implemented Interfaces:
Serializable

public class ProductDetailsContext extends Object implements Serializable
Information required to build ProductDetails for a commerce-facing product details page. This contains important context information for determining which product to gather details for and, potentially, the extent of the details.
Author:
Nathan Moore (nathandmoore)
See Also:
  • Constructor Details

  • Method Details

    • getRequest

      @Deprecated public ProductDetailsRequest getRequest()
      Deprecated.
      Not used and is marked for removal in v2.0.0 as of v1.5.0.
      The ProductDetailsRequest made that initiated the ProductDetails build process.
      Returns:
      The ProductDetailsRequest made that initiated the ProductDetails build process.
    • getResolvedProduct

      public Product getResolvedProduct()
      The resolved product for the request.
      Returns:
      The resolved product for the request.
    • getSpecificCategoryChoices

      public Map<String,ItemChoiceCategory> getSpecificCategoryChoices()
      An aggregation of all of the Categories related to the resolvedProduct. This includes the Categories used by ItemChoices.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the Categories related to the resolvedProduct.
    • getRelatedProducts

      public Map<String,ProductDetails> getRelatedProducts()
      An aggregation of all of the Products related to the resolvedProduct. This includes the Products used by ItemChoices and IncludedProducts.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the Products related to the resolvedProduct
    • getRelatedPromotionalProducts

      public List<PromotionalProductSummary> getRelatedPromotionalProducts()
      An aggregation of all of the PromotionalProducts related to the resolvedProduct.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the PromotionalProducts related to the resolvedProduct.
    • getRelatedProductAssets

      public Map<String,List<ProductAsset>> getRelatedProductAssets()
      An aggregation of all of the ProductAssets related to the resolvedProduct. This includes only direct Product assets since SpecificItemChoice assets and IncludedProduct assets will already be populated.

      The key is the ID of the parent product.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the ProductAssets related to the resolvedProduct
    • getRelatedDataDrivenEnums

      public List<DataDrivenEnum> getRelatedDataDrivenEnums()
      An aggregation of all of the DataDrivenEnums related to the resolvedProduct.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the DataDrivenEnums related to the resolvedProduct
    • getRelatedCategoryProducts

      public Map<String,Set<ProductDetails>> getRelatedCategoryProducts()
      An aggregation of all of the Products belonging to related Categories mapped by the category's ID.
      Returns:
      An aggregation of all of the Products belonging to related Categories mapped by the category's ID.
    • getRelatedVariants

      public Map<String,VariantDetail> getRelatedVariants()
      An aggregation of all of the Variants related to the resolvedProduct. This includes the Variants used by ItemChoices and IncludedProducts.

      This allows the DB to be queried fewer times during the build process.

      Returns:
      An aggregation of all of the Variants related to the resolvedProduct
    • getParentCategories

      public Set<CategoryRef> getParentCategories()
      Set of all Categories that include resolvedProduct.
      Returns:
      Set of all Categories that include resolvedProduct.
    • getRelatedProductTags

      public Map<String,List<ProductTag>> getRelatedProductTags()
      Map of all ProductTags of the relatedProducts. Mapped by the parent product's ID. The ProductTag.getTag() should be hydrated before adding to this map.
      Returns:
      Map of all ProductTags of the relatedProducts.
    • setRequest

      @Deprecated public void setRequest(ProductDetailsRequest request)
      Deprecated.
      Not used and is marked for removal in v2.0.0 as of v1.5.0.
      The ProductDetailsRequest made that initiated the ProductDetails build process.
      Parameters:
      request - The ProductDetailsRequest made that initiated the ProductDetails build process.
    • setResolvedProduct

      public void setResolvedProduct(Product resolvedProduct)
      The resolved product for the request.
      Parameters:
      resolvedProduct - The resolved product for the request.
    • setSpecificCategoryChoices

      public void setSpecificCategoryChoices(Map<String,ItemChoiceCategory> specificCategoryChoices)
      An aggregation of all of the Categories related to the resolvedProduct. This includes the Categories used by ItemChoices.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      specificCategoryChoices - An aggregation of all of the Categories related to the resolvedProduct.
    • setRelatedProducts

      public void setRelatedProducts(Map<String,ProductDetails> relatedProducts)
      An aggregation of all of the Products related to the resolvedProduct. This includes the Products used by ItemChoices and IncludedProducts.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      relatedProducts - aggregation of all of the Products related to the resolvedProduct
    • setRelatedPromotionalProducts

      public void setRelatedPromotionalProducts(List<PromotionalProductSummary> relatedPromotionalProducts)
      An aggregation of all of the PromotionalProducts related to the resolvedProduct.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      relatedPromotionalProducts - An aggregation of all of the PromotionalProducts related to the resolvedProduct.
    • setRelatedProductAssets

      public void setRelatedProductAssets(Map<String,List<ProductAsset>> relatedProductAssets)
      An aggregation of all of the ProductAssets related to the resolvedProduct. This includes only direct Product assets since SpecificItemChoice assets and IncludedProduct assets will already be populated.

      The key is the ID of the parent product.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      relatedProductAssets - An aggregation of all of the ProductAssets related to the resolvedProduct
    • setRelatedDataDrivenEnums

      public void setRelatedDataDrivenEnums(List<DataDrivenEnum> relatedDataDrivenEnums)
      An aggregation of all of the DataDrivenEnums related to the resolvedProduct.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      relatedDataDrivenEnums - An aggregation of all of the DataDrivenEnums related to the resolvedProduct
    • setRelatedCategoryProducts

      public void setRelatedCategoryProducts(Map<String,Set<ProductDetails>> relatedCategoryProducts)
      An aggregation of all of the Products belonging to related Categories mapped by the category's ID.
      Parameters:
      relatedCategoryProducts - An aggregation of all of the Products belonging to related Categories mapped by the category's ID.
    • setRelatedVariants

      public void setRelatedVariants(Map<String,VariantDetail> relatedVariants)
      An aggregation of all of the Variants related to the resolvedProduct. This includes the Variants used by ItemChoices and IncludedProducts.

      This allows the DB to be queried fewer times during the build process.

      Parameters:
      relatedVariants - An aggregation of all of the Variants related to the resolvedProduct
    • setParentCategories

      public void setParentCategories(Set<CategoryRef> parentCategories)
      Set of all Categories that include resolvedProduct.
      Parameters:
      relatedCategories - Set of all Categories that include resolvedProduct.
    • setRelatedProductTags

      public void setRelatedProductTags(Map<String,List<ProductTag>> relatedProductTags)
      Map of all ProductTags of the relatedProducts. Mapped by the parent product's ID. The ProductTag.getTag() should be hydrated before adding to this map.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object