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
ConstructorDescriptionProductDetailsContext
(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, Map<String, List<ProductTag>> relatedProductTags, Map<String, OptionTemplate> relatedOptionTemplates) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Set of allCategories
that includeresolvedProduct
.An aggregation of all of theProducts
belonging to relatedCategories
mapped by the category's ID.An aggregation of all of theDataDrivenEnums
related to theresolvedProduct
.An aggregation of allOption Templates
related to theresolvedProduct
.An aggregation of all of theProductAssets
related to theresolvedProduct
.An aggregation of all of theProducts
related to theresolvedProduct
.Map of allProductTags
of therelatedProducts
.An aggregation of all of thePromotionalProducts
related to theresolvedProduct
.An aggregation of all of theVariants
related to theresolvedProduct
.Deprecated.Not used and is marked for removal in v2.0.0 as of v1.5.0.The resolved product for therequest
.An aggregation of all of theCategories
related to theresolvedProduct
.int
hashCode()
void
setParentCategories
(Set<CategoryRef> parentCategories) Set of allCategories
that includeresolvedProduct
.void
setRelatedCategoryProducts
(Map<String, Set<ProductDetails>> relatedCategoryProducts) An aggregation of all of theProducts
belonging to relatedCategories
mapped by the category's ID.void
setRelatedDataDrivenEnums
(List<DataDrivenEnum> relatedDataDrivenEnums) An aggregation of all of theDataDrivenEnums
related to theresolvedProduct
.void
setRelatedOptionTemplates
(Map<String, OptionTemplate> relatedOptionTemplates) An aggregation of allOption Templates
related to theresolvedProduct
.void
setRelatedProductAssets
(Map<String, List<ProductAsset>> relatedProductAssets) An aggregation of all of theProductAssets
related to theresolvedProduct
.void
setRelatedProducts
(Map<String, ProductDetails> relatedProducts) An aggregation of all of theProducts
related to theresolvedProduct
.void
setRelatedProductTags
(Map<String, List<ProductTag>> relatedProductTags) Map of allProductTags
of therelatedProducts
.void
setRelatedPromotionalProducts
(List<PromotionalProductSummary> relatedPromotionalProducts) An aggregation of all of thePromotionalProducts
related to theresolvedProduct
.void
setRelatedVariants
(Map<String, VariantDetail> relatedVariants) An aggregation of all of theVariants
related to theresolvedProduct
.void
setRequest
(ProductDetailsRequest request) Deprecated.Not used and is marked for removal in v2.0.0 as of v1.5.0.void
setResolvedProduct
(Product resolvedProduct) The resolved product for therequest
.void
setSpecificCategoryChoices
(Map<String, ItemChoiceCategory> specificCategoryChoices) An aggregation of all of theCategories
related 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, Map<String, List<ProductTag>> relatedProductTags, Map<String, OptionTemplate> relatedOptionTemplates)
-
-
Method Details
-
getRequest
Deprecated.Not used and is marked for removal in v2.0.0 as of v1.5.0.TheProductDetailsRequest
made that initiated theProductDetails
build process.- Returns:
- The
ProductDetailsRequest
made that initiated theProductDetails
build process.
-
getResolvedProduct
The resolved product for therequest
.- Returns:
- The resolved product for the
request
.
-
getSpecificCategoryChoices
An aggregation of all of theCategories
related 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
Categories
related to theresolvedProduct
.
-
getRelatedProducts
An aggregation of all of theProducts
related to theresolvedProduct
. This includes the Products used byItemChoices
andIncludedProducts
.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
Products
related to theresolvedProduct
-
getRelatedPromotionalProducts
An aggregation of all of thePromotionalProducts
related to theresolvedProduct
.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
PromotionalProducts
related to theresolvedProduct
.
-
getRelatedProductAssets
An aggregation of all of theProductAssets
related to theresolvedProduct
. This includes only direct Product assets sinceSpecificItemChoice assets
andIncludedProduct 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 theresolvedProduct
-
getRelatedDataDrivenEnums
An aggregation of all of theDataDrivenEnums
related to theresolvedProduct
.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
DataDrivenEnums
related to theresolvedProduct
-
getRelatedCategoryProducts
An aggregation of all of theProducts
belonging to relatedCategories
mapped by the category's ID.- Returns:
- An aggregation of all of the
Products
belonging to relatedCategories
mapped by the category's ID.
-
getRelatedVariants
An aggregation of all of theVariants
related to theresolvedProduct
. This includes the Variants used byItemChoices
andIncludedProducts
.This allows the DB to be queried fewer times during the build process.
- Returns:
- An aggregation of all of the
Variants
related to theresolvedProduct
-
getParentCategories
Set of allCategories
that includeresolvedProduct
.- Returns:
- Set of all
Categories
that includeresolvedProduct
.
-
getRelatedProductTags
Map of allProductTags
of therelatedProducts
. Mapped by the parent product's ID. TheProductTag.getTag()
should be hydrated before adding to this map.- Returns:
- Map of all
ProductTags
of therelatedProducts
.
-
getRelatedOptionTemplates
An aggregation of allOption Templates
related 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
OptionTemplates
of theresolvedProduct
-
setRequest
Deprecated.Not used and is marked for removal in v2.0.0 as of v1.5.0.TheProductDetailsRequest
made that initiated theProductDetails
build process.- Parameters:
request
- TheProductDetailsRequest
made that initiated theProductDetails
build process.
-
setResolvedProduct
The resolved product for therequest
.- Parameters:
resolvedProduct
- The resolved product for therequest
.
-
setSpecificCategoryChoices
An aggregation of all of theCategories
related 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 theCategories
related to theresolvedProduct
.
-
setRelatedProducts
An aggregation of all of theProducts
related to theresolvedProduct
. This includes the Products used byItemChoices
andIncludedProducts
.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedProducts
- aggregation of all of theProducts
related to theresolvedProduct
-
setRelatedPromotionalProducts
public void setRelatedPromotionalProducts(List<PromotionalProductSummary> relatedPromotionalProducts) An aggregation of all of thePromotionalProducts
related to theresolvedProduct
.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedPromotionalProducts
- An aggregation of all of thePromotionalProducts
related to theresolvedProduct
.
-
setRelatedProductAssets
An aggregation of all of theProductAssets
related to theresolvedProduct
. This includes only direct Product assets sinceSpecificItemChoice assets
andIncludedProduct 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 theProductAssets
related to theresolvedProduct
-
setRelatedDataDrivenEnums
An aggregation of all of theDataDrivenEnums
related to theresolvedProduct
.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedDataDrivenEnums
- An aggregation of all of theDataDrivenEnums
related to theresolvedProduct
-
setRelatedCategoryProducts
An aggregation of all of theProducts
belonging to relatedCategories
mapped by the category's ID.- Parameters:
relatedCategoryProducts
- An aggregation of all of theProducts
belonging to relatedCategories
mapped by the category's ID.
-
setRelatedVariants
An aggregation of all of theVariants
related to theresolvedProduct
. This includes the Variants used byItemChoices
andIncludedProducts
.This allows the DB to be queried fewer times during the build process.
- Parameters:
relatedVariants
- An aggregation of all of theVariants
related to theresolvedProduct
-
setParentCategories
Set of allCategories
that includeresolvedProduct
.- Parameters:
relatedCategories
- Set of allCategories
that includeresolvedProduct
.
-
setRelatedProductTags
Map of allProductTags
of therelatedProducts
. Mapped by the parent product's ID. TheProductTag.getTag()
should be hydrated before adding to this map. -
setRelatedOptionTemplates
An aggregation of allOption Templates
related 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 allOptionTemplates
of theresolvedProduct
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-