Class ProductDetailsRequest
java.lang.Object
com.broadleafcommerce.catalog.domain.product.commerce.ProductDetailsRequest
- All Implemented Interfaces:
Serializable
A structure representing a request for a commerce-facing product details page including
identifying information for the product for which to get details and interesting context
information.
- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProductDetailsRequest(Set<String> productUris, Set<String> productIds, Set<String> variantIds, boolean hydrateCategoryChoiceProducts, boolean hydrateProductAssets, boolean hydrateRelatedProductCharacteristics, String variantHydrationBehavior, boolean hydratePromotionProducts, Map<String, Object> attributes, Set<Variant> resolvedVariants, Set<String> productIdsNotFound, Set<String> variantIdsNotFound, Set<String> productUrisNotFound) -
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.TheProduct.getId()product IDs} matching the products for whichProductDetailsare requested.The list of requestedproductIdsthat were not resolvable.Theproduct urismatching the products for whichProductDetailsare requested.The list of requestedproductUristhat were not resolvable.The resolvedVariantsmatching thevariantIds.Determines the behavior of the system with regard to hydratingVariantsonto theProductDetailsfor the requested products.Thevariant IDsmatching the variants for whichProductDetailsare requested.The list of requestedvariantIdsthat were not resolvable.inthashCode()booleanWhether to hydrate category products ontocategoriesbelonging toItemChoiceProductOptionsif the entity is a product.booleanWhether to hydrate non-primary product assets onto theProductDetailsresponse if the entity is a product.booleanWhether to hydrate promotional products for the requested products.booleanWhether to hydrate theCharacteristicsfor the main requested products' related products if the entity is a product.voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetHydrateCategoryChoiceProducts(boolean hydrateCategoryChoiceProducts) Whether to hydrate category products ontocategoriesbelonging toItemChoiceProductOptionsif the entity is a product.voidsetHydrateProductAssets(boolean hydrateProductAssets) Whether to hydrate non-primary product assets onto theProductDetailsresponse if the entity is a product.voidsetHydratePromotionProducts(boolean hydratePromotionProducts) Whether to hydrate promotional products for the requested products.voidsetHydrateRelatedProductCharacteristics(boolean hydrateRelatedProductCharacteristics) Whether to hydrate theCharacteristicsfor the main requested products' related products if the entity is a product.voidsetProductIds(Set<String> productIds) TheProduct.getId()product IDs} matching the products for whichProductDetailsare requested.voidsetProductIdsNotFound(Set<String> productIdsNotFound) The list of requestedproductIdsthat were not resolvable.voidsetProductUris(Set<String> productUris) Theproduct urismatching the products for whichProductDetailsare requested.voidsetProductUrisNotFound(Set<String> productUrisNotFound) The list of requestedproductUristhat were not resolvable.voidsetResolvedVariants(Set<Variant> resolvedVariants) The resolvedVariantsmatching thevariantIds.voidsetVariantHydrationBehavior(String variantHydrationBehavior) Determines the behavior of the system with regard to hydratingVariantsonto theProductDetailsfor the requested products.voidsetVariantIds(Set<String> variantIds) Thevariant IDsmatching the variants for whichProductDetailsare requested.voidsetVariantIdsNotFound(Set<String> variantIdsNotFound) The list of requestedvariantIdsthat were not resolvable.toString()
-
Constructor Details
-
ProductDetailsRequest
public ProductDetailsRequest(Set<String> productUris, Set<String> productIds, Set<String> variantIds, boolean hydrateCategoryChoiceProducts, boolean hydrateProductAssets, boolean hydrateRelatedProductCharacteristics, String variantHydrationBehavior, boolean hydratePromotionProducts, Map<String, Object> attributes, Set<Variant> resolvedVariants, Set<String> productIdsNotFound, Set<String> variantIdsNotFound, Set<String> productUrisNotFound) -
ProductDetailsRequest
public ProductDetailsRequest()
-
-
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.
-
getProductUris
Theproduct urismatching the products for whichProductDetailsare requested. IfproductIdsis non-null, then it is used instead of this field.- Returns:
- The
product urimatching the product for whichProductDetailsare requested.
-
getProductIds
TheProduct.getId()product IDs} matching the products for whichProductDetailsare requested. If this field is non-null, then it is used instead ofproductUris.- Returns:
- The
Product.getId()product ID} matching the product for whichProductDetailsare requested.
-
getVariantIds
Thevariant IDsmatching the variants for whichProductDetailsare requested. The parentProductsof the resolvedVariantswill be resolved and returned in theProductDetailsList.This is particularly useful when used in conjunction with
variantHydrationBehaviorto only return the specific variants and their parent products rather than including every variant of the parent.- Returns:
- The variant IDs matching the variants for which
ProductDetailsare requested. - Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
isHydrateCategoryChoiceProducts
public boolean isHydrateCategoryChoiceProducts()Whether to hydrate category products ontocategoriesbelonging toItemChoiceProductOptionsif the entity is a product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
isHydrateProductAssets
public boolean isHydrateProductAssets()Whether to hydrate non-primary product assets onto theProductDetailsresponse if the entity is a product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
isHydrateRelatedProductCharacteristics
public boolean isHydrateRelatedProductCharacteristics()Whether to hydrate theCharacteristicsfor the main requested products' related products if the entity is a product. The main requested products' characteristics are always hydrated.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
getVariantHydrationBehavior
Determines the behavior of the system with regard to hydratingVariantsonto theProductDetailsfor the requested products. Particularly, whether to hydrate all variants for the requested products, no variants, or just the default variant. By default, this is null and the behavior is instead determined byProductDetailsProperties.getVariantHydrationBehavior().Note: Variants for the
variantIdsare always hydrated if resolved.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
- See Also:
-
isHydratePromotionProducts
public boolean isHydratePromotionProducts()Whether to hydrate promotional products for the requested products.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
getResolvedVariants
The resolvedVariantsmatching thevariantIds.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
getProductIdsNotFound
The list of requestedproductIdsthat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
getVariantIdsNotFound
The list of requestedvariantIdsthat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
getProductUrisNotFound
The list of requestedproductUristhat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setProductUris
Theproduct urismatching the products for whichProductDetailsare requested. IfproductIdsis non-null, then it is used instead of this field.- Parameters:
uri- Theproduct urimatching the product for whichProductDetailsare requested.
-
setProductIds
TheProduct.getId()product IDs} matching the products for whichProductDetailsare requested. If this field is non-null, then it is used instead ofproductUris.- Parameters:
uri- TheProduct.getId()product ID} matching the product for whichProductDetailsare requested.
-
setVariantIds
Thevariant IDsmatching the variants for whichProductDetailsare requested. The parentProductsof the resolvedVariantswill be resolved and returned in theProductDetailsList.This is particularly useful when used in conjunction with
variantHydrationBehaviorto only return the specific variants and their parent products rather than including every variant of the parent.- Parameters:
variantIds- The variant IDs matching the variants for whichProductDetailsare requested.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setHydrateCategoryChoiceProducts
public void setHydrateCategoryChoiceProducts(boolean hydrateCategoryChoiceProducts) Whether to hydrate category products ontocategoriesbelonging toItemChoiceProductOptionsif the entity is a product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
setHydrateProductAssets
public void setHydrateProductAssets(boolean hydrateProductAssets) Whether to hydrate non-primary product assets onto theProductDetailsresponse if the entity is a product.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
setHydrateRelatedProductCharacteristics
public void setHydrateRelatedProductCharacteristics(boolean hydrateRelatedProductCharacteristics) Whether to hydrate theCharacteristicsfor the main requested products' related products if the entity is a product. The main requested products' characteristics are always hydrated.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-
setVariantHydrationBehavior
Determines the behavior of the system with regard to hydratingVariantsonto theProductDetailsfor the requested products. Particularly, whether to hydrate all variants for the requested products, no variants, or just the default variant. By default, this is null and the behavior is instead determined byProductDetailsProperties.getVariantHydrationBehavior().Note: Variants for the
variantIdsare always hydrated if resolved.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
- See Also:
-
setHydratePromotionProducts
public void setHydratePromotionProducts(boolean hydratePromotionProducts) Whether to hydrate promotional products for the requested products.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setResolvedVariants
The resolvedVariantsmatching thevariantIds.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setProductIdsNotFound
The list of requestedproductIdsthat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setVariantIdsNotFound
The list of requestedvariantIdsthat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
setProductUrisNotFound
The list of requestedproductUristhat were not resolvable.- Since:
- Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-