Class CategoryDetailsContext

java.lang.Object
com.broadleafcommerce.catalog.domain.category.commerce.CategoryDetailsContext
All Implemented Interfaces:
Serializable

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

  • Method Details

    • getRequest

      public CategoryDetailsRequest getRequest()
      The CategoryDetailsRequest made that initiated the CategoryDetails build process.
      Returns:
      The CategoryDetailsRequest made that initiated the CategoryDetails build process.
    • getResolvedCategory

      public Category getResolvedCategory()
      The resolved category for the request.
      Returns:
      The resolved category for the request.
    • getRelatedCategoryAssets

      public Map<String,List<CategoryAsset>> getRelatedCategoryAssets()
      An aggregation of all of the CategoryAssets related to the resolvedCategory.

      The key is the ID of the parent category.

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

      Returns:
      An aggregation of all of the CategoryAssets related to the resolvedCategory
    • getRelatedCategoryProducts

      public Map<String,org.springframework.data.domain.Page<ProductSummary>> getRelatedCategoryProducts()
      An aggregation of all of the Products related to the resolvedCategory.
      Returns:
      An aggregation of all of the Products related to the resolvedCategory.
    • getRelatedRuleBasedProducts

      public org.springframework.data.domain.Page<ProductSummary> getRelatedRuleBasedProducts()
      An aggregation of all of the Products related to the resolvedCategory when it is CategoryProductMembershipType.RULE_BASED.
      Returns:
      An aggregation of all of the Products related to the resolvedCategory.
    • getRelatedProducts

      public Map<String,ProductSummary> getRelatedProducts()
      An aggregation of all of the Products related to the resolvedCategory.

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

      Returns:
      An aggregation of all of the Products related to the resolvedCategory
    • getRelatedProductAssets

      public Map<String,List<ProductAsset>> getRelatedProductAssets()
      An aggregation of all of the ProductAssets related to the relatedProducts.

      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 relatedProducts
    • getRelatedVariants

      public Map<String,VariantDetail> getRelatedVariants()
      An aggregation of all of the Variants related to the relatedProducts.

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

      Returns:
      An aggregation of all of the Variants related to the relatedProducts
    • getRelatedPromotionalProducts

      public Map<String,List<PromotionalCategoryProductSummary>> getRelatedPromotionalProducts()
      An aggregation of all of the PromotionalProducts related to the resolvedCategory mapped by their type.
      Returns:
      An aggregation of all of the PromotionalProducts related to the resolvedCategory mapped by their type.
    • 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

      public void setRequest(CategoryDetailsRequest request)
      The CategoryDetailsRequest made that initiated the CategoryDetails build process.
      Parameters:
      request - The CategoryDetailsRequest made that initiated the CategoryDetails build process.
    • setResolvedCategory

      public void setResolvedCategory(Category resolvedCategory)
      The resolved category for the request.
      Parameters:
      resolvedCategory - The resolved category for the request.
    • setRelatedCategoryAssets

      public void setRelatedCategoryAssets(Map<String,List<CategoryAsset>> relatedCategoryAssets)
      An aggregation of all of the CategoryAssets related to the resolvedCategory.

      The key is the ID of the parent category.

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

      Parameters:
      relatedCategoryAssets - An aggregation of all of the CategoryAssets related to the resolvedCategory
    • setRelatedCategoryProducts

      public void setRelatedCategoryProducts(Map<String,org.springframework.data.domain.Page<ProductSummary>> relatedCategoryProducts)
      An aggregation of all of the Products related to the resolvedCategory.
      Parameters:
      relatedCategoryProducts - An aggregation of all of the Products related to the resolvedCategory.
    • setRelatedRuleBasedProducts

      public void setRelatedRuleBasedProducts(org.springframework.data.domain.Page<ProductSummary> relatedRuleBasedProducts)
      An aggregation of all of the Products related to the resolvedCategory when it is CategoryProductMembershipType.RULE_BASED.
      Parameters:
      relatedRuleBasedProducts - An aggregation of all of the Products related to the resolvedCategory.
    • setRelatedProducts

      public void setRelatedProducts(Map<String,ProductSummary> relatedProducts)
      An aggregation of all of the Products related to the resolvedCategory.

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

      Parameters:
      relatedProducts - aggregation of all of the Products related to the resolvedCategory
    • setRelatedProductAssets

      public void setRelatedProductAssets(Map<String,List<ProductAsset>> relatedProductAssets)
      An aggregation of all of the ProductAssets related to the relatedProducts.

      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 relatedProducts
    • setRelatedVariants

      public void setRelatedVariants(Map<String,VariantDetail> relatedVariants)
      An aggregation of all of the Variants related to the relatedProducts.

      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 relatedProducts
    • setRelatedPromotionalProducts

      public void setRelatedPromotionalProducts(Map<String,List<PromotionalCategoryProductSummary>> relatedPromotionalProducts)
      An aggregation of all of the PromotionalProducts related to the resolvedCategory mapped by their type.
      Parameters:
      relatedPromotionalProducts - An aggregation of all of the PromotionalProducts related to the resolvedCategory mapped by their type.
    • 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
    • getCategoryUrl

      public String getCategoryUrl()
    • getCategoryId

      public String getCategoryId()
    • getProductPageInfo

      public org.springframework.data.domain.Pageable getProductPageInfo()
    • getAttributes

      public org.springframework.util.MultiValueMap<String,String> getAttributes()
    • setCategoryUrl

      public void setCategoryUrl(String categoryUrl)
    • setCategoryId

      public void setCategoryId(String categoryId)
    • setProductPageInfo

      public void setProductPageInfo(org.springframework.data.domain.Pageable productPageInfo)
    • setAttributes

      public void setAttributes(org.springframework.util.MultiValueMap<String,String> attributes)