Class Category
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.Category
- All Implemented Interfaces:
Serializable
A structure containing all the info necessary for a category details page or section shown in a
commerce-facing app (as opposed to a PIM UI).
- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanReturn any additional attributes passed in the request not matching any defined properties.Map holding any additional attributes passed in the request not matching any defined properties.getId()The context ID of the category.The locale used to check if a related product is a member of this category.The rule string used to check if a related product is a member of this category.Determines how this category defines membership of its products.A page ofProductsbelonging to the category.A map ofpromotional productsbelonging to the category.IfCategoryDetailsRequest.isHydrateCategoryProductsFromSearch()orBrowseDetailsRequest.isHydrateCategoryProductsFromSearch()is true, then this will be populated instead ofproducts.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidThe context ID of the category.voidsetProductMembershipLocale(Locale productMembershipLocale) The locale used to check if a related product is a member of this category.voidsetProductMembershipRule(String productMembershipRule) The rule string used to check if a related product is a member of this category.voidsetProductMembershipType(String productMembershipType) Determines how this category defines membership of its products.voidsetProducts(SimplePage<Product> products) A page ofProductsbelonging to the category.voidsetPromotionalProducts(Map<String, List<PromotionalCategoryProduct>> promotionalProducts) A map ofpromotional productsbelonging to the category.voidsetSearchResponse(SearchResponse<Product> searchResponse) IfCategoryDetailsRequest.isHydrateCategoryProductsFromSearch()orBrowseDetailsRequest.isHydrateCategoryProductsFromSearch()is true, then this will be populated instead ofproducts.toString()
-
Constructor Details
-
Category
public Category()
-
-
Method Details
-
addAttribute
Takes in any additional attributes passed in the request not matching any defined properties.- Parameters:
name- Name of the additional attributevalue- Value of the additional attribute
-
getAttribute
Return any additional attributes passed in the request not matching any defined properties.- Returns:
- any additional attributes passed in the request not matching any defined properties.
-
getId
The context ID of the category.- Returns:
- the context ID of the category
-
getProducts
A page ofProductsbelonging to the category. To configure the page pass paging params to the endpoint.- Returns:
- A page of
Productsbelonging to the category.
-
getPromotionalProducts
A map ofpromotional productsbelonging to the category.- Returns:
- A map of
promotional productsbelonging to the category.
-
getProductMembershipType
Determines how this category defines membership of its products. Valid types are found atCategoryProductMembershipType.- Returns:
- the product membership type of the category
- See Also:
-
getProductMembershipRule
The rule string used to check if a related product is a member of this category. Only applies when this category'sproduct membership typeisCategoryProductMembershipType.RULE_BASED.- Returns:
- the expression used to evaluate a related product's membership in this category
- See Also:
-
getProductMembershipLocale
The locale used to check if a related product is a member of this category. Only applies when this category'sproduct membership typeisCategoryProductMembershipType.RULE_BASED. By default, this is set as the catalog locale.- Returns:
- the locale used to evaluate a related product's membership in this category
- See Also:
-
getSearchResponse
IfCategoryDetailsRequest.isHydrateCategoryProductsFromSearch()orBrowseDetailsRequest.isHydrateCategoryProductsFromSearch()is true, then this will be populated instead ofproducts. -
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setId
The context ID of the category.- Parameters:
id- the context ID of the category
-
setProducts
A page ofProductsbelonging to the category. To configure the page pass paging params to the endpoint.- Parameters:
products- A page ofProductsbelonging to the category.
-
setPromotionalProducts
public void setPromotionalProducts(Map<String, List<PromotionalCategoryProduct>> promotionalProducts) A map ofpromotional productsbelonging to the category.- Parameters:
products- A map ofpromotional productsbelonging to the category.
-
setProductMembershipType
Determines how this category defines membership of its products. Valid types are found atCategoryProductMembershipType.- Parameters:
productMembershipType- the product membership type of the category- See Also:
-
setProductMembershipRule
The rule string used to check if a related product is a member of this category. Only applies when this category'sproduct membership typeisCategoryProductMembershipType.RULE_BASED.- Parameters:
productMembershipRule- an expression based off ofProductcriteria- See Also:
-
setProductMembershipLocale
The locale used to check if a related product is a member of this category. Only applies when this category'sproduct membership typeisCategoryProductMembershipType.RULE_BASED. By default, this is set as the catalog locale.- Parameters:
productMembershipLocale- the locale to evaluate the membership rule- See Also:
-
setSearchResponse
IfCategoryDetailsRequest.isHydrateCategoryProductsFromSearch()orBrowseDetailsRequest.isHydrateCategoryProductsFromSearch()is true, then this will be populated instead ofproducts. -
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-