Class ProductDetailsContext
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionProductDetailsContext(ProductDetailsRequest request, Product resolvedProduct, Map<String, ItemChoiceCategory> specificCategoryChoices, Map<String, ProductDetails> relatedProducts, List<PromotionalProductSummary> relatedPromotionalProducts, Map<String, List<ProductAsset>> relatedProductAssets, List<DataDrivenEnum> relatedDataDrivenEnums, Map<String, Set<ProductDetails>> relatedCategoryProducts, Map<String, VariantDetail> relatedVariants, Set<CategoryRef> parentCategories, List<String> categoryIdsWithParents, Map<String, List<ProductTag>> relatedProductTags, Map<String, OptionTemplate> relatedOptionTemplates, List<Characteristic> relatedCharacteristics) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanList of all hierarchical parent category ids for the product.Set of allCategoriesthat includeresolvedProduct.An aggregation of all of theProductsbelonging to relatedCategoriesmapped by the category's ID.An aggregation of all of theCharacteristicsrelated to the resolved product.An aggregation of all of theDataDrivenEnumsrelated to theresolvedProduct.An aggregation of allOption Templatesrelated to theresolvedProduct.An aggregation of all of theProductAssetsrelated to theresolvedProduct.An aggregation of all of theProductsrelated to theresolvedProduct.Map of allProductTagsof therelatedProducts.An aggregation of all of thePromotionalProductsrelated to theresolvedProduct.An aggregation of all of theVariantsrelated to theresolvedProduct.TheProductDetailsRequestmade that initiated theProductDetailsbuild process.The resolved product for therequest.An aggregation of all of theCategoriesrelated to theresolvedProduct.inthashCode()voidsetCategoryIdsWithParents(List<String> categoryIdsWithParents) List of all hierarchical parent category ids for the product.voidsetParentCategories(Set<CategoryRef> parentCategories) Set of allCategoriesthat includeresolvedProduct.voidsetRelatedCategoryProducts(Map<String, Set<ProductDetails>> relatedCategoryProducts) An aggregation of all of theProductsbelonging to relatedCategoriesmapped by the category's ID.voidsetRelatedCharacteristics(List<Characteristic> relatedCharacteristics) An aggregation of all of theCharacteristicsrelated to the resolved product.voidsetRelatedDataDrivenEnums(List<DataDrivenEnum> relatedDataDrivenEnums) An aggregation of all of theDataDrivenEnumsrelated to theresolvedProduct.voidsetRelatedOptionTemplates(Map<String, OptionTemplate> relatedOptionTemplates) An aggregation of allOption Templatesrelated to theresolvedProduct.voidsetRelatedProductAssets(Map<String, List<ProductAsset>> relatedProductAssets) An aggregation of all of theProductAssetsrelated to theresolvedProduct.voidsetRelatedProducts(Map<String, ProductDetails> relatedProducts) An aggregation of all of theProductsrelated to theresolvedProduct.voidsetRelatedProductTags(Map<String, List<ProductTag>> relatedProductTags) Map of allProductTagsof therelatedProducts.voidsetRelatedPromotionalProducts(List<PromotionalProductSummary> relatedPromotionalProducts) An aggregation of all of thePromotionalProductsrelated to theresolvedProduct.voidsetRelatedVariants(Map<String, VariantDetail> relatedVariants) An aggregation of all of theVariantsrelated to theresolvedProduct.voidsetRequest(ProductDetailsRequest request) TheProductDetailsRequestmade that initiated theProductDetailsbuild process.voidsetResolvedProduct(Product resolvedProduct) The resolved product for therequest.voidsetSpecificCategoryChoices(Map<String, ItemChoiceCategory> specificCategoryChoices) An aggregation of all of theCategoriesrelated to theresolvedProduct.toString()
-
Constructor Details
-
ProductDetailsContext
public ProductDetailsContext() -
ProductDetailsContext
public ProductDetailsContext(ProductDetailsRequest request, Product resolvedProduct, Map<String, ItemChoiceCategory> specificCategoryChoices, Map<String, ProductDetails> relatedProducts, List<PromotionalProductSummary> relatedPromotionalProducts, Map<String, List<ProductAsset>> relatedProductAssets, List<DataDrivenEnum> relatedDataDrivenEnums, Map<String, Set<ProductDetails>> relatedCategoryProducts, Map<String, VariantDetail> relatedVariants, Set<CategoryRef> parentCategories, List<String> categoryIdsWithParents, Map<String, List<ProductTag>> relatedProductTags, Map<String, OptionTemplate> relatedOptionTemplates, List<Characteristic> relatedCharacteristics)
-
-
Method Details
-
getRequest
TheProductDetailsRequestmade that initiated theProductDetailsbuild process.- Returns:
- The
ProductDetailsRequestmade that initiated theProductDetailsbuild process.
-
getResolvedProduct
The resolved product for therequest.- Returns:
- The resolved product for the
request.
-
getSpecificCategoryChoices
An aggregation of all of theCategoriesrelated to theresolvedProduct. This includes the Categories used byItemChoices.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
Categoriesrelated to theresolvedProduct.
-
getRelatedProducts
An aggregation of all of theProductsrelated to theresolvedProduct. This includes the Products used byItemChoicesandIncludedProducts.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
Productsrelated to theresolvedProduct
-
getRelatedPromotionalProducts
An aggregation of all of thePromotionalProductsrelated to theresolvedProduct.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
PromotionalProductsrelated to theresolvedProduct.
-
getRelatedProductAssets
An aggregation of all of theProductAssetsrelated to theresolvedProduct. This includes only direct Product assets sinceSpecificItemChoice assetsandIncludedProduct assetswill 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
ProductAssetsrelated to theresolvedProduct
-
getRelatedDataDrivenEnums
An aggregation of all of theDataDrivenEnumsrelated to theresolvedProduct.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
DataDrivenEnumsrelated to theresolvedProduct
-
getRelatedCategoryProducts
An aggregation of all of theProductsbelonging to relatedCategoriesmapped by the category's ID.- Returns:
- An aggregation of all of the
Productsbelonging to relatedCategoriesmapped by the category's ID.
-
getRelatedVariants
An aggregation of all of theVariantsrelated to theresolvedProduct. This includes the Variants used byItemChoicesandIncludedProducts.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
Variantsrelated to theresolvedProduct
-
getParentCategories
Set of allCategoriesthat includeresolvedProduct.- Returns:
- Set of all
Categoriesthat includeresolvedProduct.
-
getCategoryIdsWithParents
List of all hierarchical parent category ids for the product.This is different from
parentCategoriesasparentCategoriesrepresents the categories that are directly assigned to the product, where ascategoryIdsWithParentscontains a hierarchical list of all parent category ids.For example, if we have a category setup of: Top -> Level2 -> Level3 and the product is assigned to Level3, the list would be
{Top, Level2, Level3}.- Returns:
- List of all hierarchical parent category ids for the product.
- Since:
- Catalog Service 2.2.0 / Release Train 2.2.0, this will also include any relevant
rule-based category memberships that this
resolvedProductbelongs to ONLY if the overall applicable product details request also contains an item choice rule-based category and it qualifies as being a member. This is particularly useful for cart catalog item requests that contain dependent items that need to validate and verify rule-based category membership eligibility. SeeRelatedCategoriesProductContextContributor
-
getRelatedProductTags
Map of allProductTagsof therelatedProducts. Mapped by the parent product's ID. TheProductTag.getTag()should be hydrated before adding to this map.- Returns:
- Map of all
ProductTagsof therelatedProducts.
-
getRelatedOptionTemplates
An aggregation of allOption Templatesrelated to theresolvedProduct. This includes the Option Templates used byItemChoices. The key is the ID of the template to enable quick lookup when hydrating option referencing them.- Returns:
- relatedOptionTemplates List of all
OptionTemplatesof theresolvedProduct
-
getRelatedCharacteristics
An aggregation of all of theCharacteristicsrelated to the resolved product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
setRequest
TheProductDetailsRequestmade that initiated theProductDetailsbuild process.- Parameters:
request- TheProductDetailsRequestmade that initiated theProductDetailsbuild process.
-
setResolvedProduct
The resolved product for therequest.- Parameters:
resolvedProduct- The resolved product for therequest.
-
setSpecificCategoryChoices
An aggregation of all of theCategoriesrelated to theresolvedProduct. This includes the Categories used byItemChoices.This allows the DB to be queried fewer times during the build process.
- Parameters:
specificCategoryChoices- An aggregation of all of theCategoriesrelated to theresolvedProduct.
-
setRelatedProducts
An aggregation of all of theProductsrelated to theresolvedProduct. This includes the Products used byItemChoicesandIncludedProducts.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedProducts- aggregation of all of theProductsrelated to theresolvedProduct
-
setRelatedPromotionalProducts
public void setRelatedPromotionalProducts(List<PromotionalProductSummary> relatedPromotionalProducts) An aggregation of all of thePromotionalProductsrelated to theresolvedProduct.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedPromotionalProducts- An aggregation of all of thePromotionalProductsrelated to theresolvedProduct.
-
setRelatedProductAssets
An aggregation of all of theProductAssetsrelated to theresolvedProduct. This includes only direct Product assets sinceSpecificItemChoice assetsandIncludedProduct assetswill 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 theProductAssetsrelated to theresolvedProduct
-
setRelatedDataDrivenEnums
An aggregation of all of theDataDrivenEnumsrelated to theresolvedProduct.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedDataDrivenEnums- An aggregation of all of theDataDrivenEnumsrelated to theresolvedProduct
-
setRelatedCategoryProducts
An aggregation of all of theProductsbelonging to relatedCategoriesmapped by the category's ID.- Parameters:
relatedCategoryProducts- An aggregation of all of theProductsbelonging to relatedCategoriesmapped by the category's ID.
-
setRelatedVariants
An aggregation of all of theVariantsrelated to theresolvedProduct. This includes the Variants used byItemChoicesandIncludedProducts.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedVariants- An aggregation of all of theVariantsrelated to theresolvedProduct
-
setParentCategories
Set of allCategoriesthat includeresolvedProduct.- Parameters:
relatedCategories- Set of allCategoriesthat includeresolvedProduct.
-
setCategoryIdsWithParents
List of all hierarchical parent category ids for the product.This is different from
parentCategoriesasparentCategoriesrepresents the categories that are directly assigned to the product, where ascategoryIdsWithParentscontains a hierarchical list of all parent category ids.For example, if we have a category setup of: Top -> Level2 -> Level3 and the product is assigned to Level3, the list would be
{Top, Level2, Level3}.- Parameters:
parentCategoryIds- List of all hierarchical parent category ids for the product.- Since:
- Catalog Service 2.2.0 / Release Train 2.2.0, this will also include any relevant
rule-based category memberships that this
resolvedProductbelongs to ONLY if the overall applicable product details request also contains an item choice rule-based category and it qualifies as being a member. This is particularly useful for cart catalog item requests that contain dependent items that need to validate and verify rule-based category membership eligibility. SeeRelatedCategoriesProductContextContributor
-
setRelatedProductTags
Map of allProductTagsof therelatedProducts. Mapped by the parent product's ID. TheProductTag.getTag()should be hydrated before adding to this map. -
setRelatedOptionTemplates
An aggregation of allOption Templatesrelated to theresolvedProduct. This includes the Option Templates used byItemChoices. The key is the ID of the template to enable quick lookup when hydrating option referencing them.- Parameters:
relatedOptionTemplates- List of allOptionTemplatesof theresolvedProduct
-
setRelatedCharacteristics
An aggregation of all of theCharacteristicsrelated to the resolved product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-