Class ProductDetailsRequest

java.lang.Object
com.broadleafcommerce.catalog.domain.product.commerce.ProductDetailsRequest
All Implemented Interfaces:
Serializable

public class ProductDetailsRequest extends Object implements 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 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

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> 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

      public Set<String> getProductUris()
      The product uris matching the products for which ProductDetails are requested. If productIds is non-null, then it is used instead of this field.
      Returns:
      The product uri matching the product for which ProductDetails are requested.
    • getProductIds

      public Set<String> getProductIds()
      The Product.getId() product IDs} matching the products for which ProductDetails are requested. If this field is non-null, then it is used instead of productUris.
      Returns:
      The Product.getId() product ID} matching the product for which ProductDetails are requested.
    • getVariantIds

      public Set<String> getVariantIds()
      The variant IDs matching the variants for which ProductDetails are requested. The parent Products of the resolved Variants will be resolved and returned in the ProductDetailsList.

      This is particularly useful when used in conjunction with variantHydrationBehavior to 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 ProductDetails are requested.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • isHydrateCategoryChoiceProducts

      public boolean isHydrateCategoryChoiceProducts()
      Whether to hydrate category products onto categories belonging to ItemChoice ProductOptions if 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 the ProductDetails response if the entity is a product.
      Since:
      Catalog Service 2.2.0, Release Train 2.2.0
    • isHydrateRelatedProductCharacteristics

      public boolean isHydrateRelatedProductCharacteristics()
      Whether to hydrate the Characteristics for 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

      public String getVariantHydrationBehavior()
      Determines the behavior of the system with regard to hydrating Variants onto the ProductDetails for 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 by ProductDetailsProperties.getVariantHydrationBehavior().

      Note: Variants for the variantIds are 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

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • getResolvedVariants

      public Set<Variant> getResolvedVariants()
      The resolved Variants matching the variantIds.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • getProductIdsNotFound

      public Set<String> getProductIdsNotFound()
      The list of requested productIds that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • getVariantIdsNotFound

      public Set<String> getVariantIdsNotFound()
      The list of requested variantIds that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • getProductUrisNotFound

      public Set<String> getProductUrisNotFound()
      The list of requested productUris that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • setProductUris

      public void setProductUris(Set<String> productUris)
      The product uris matching the products for which ProductDetails are requested. If productIds is non-null, then it is used instead of this field.
      Parameters:
      uri - The product uri matching the product for which ProductDetails are requested.
    • setProductIds

      public void setProductIds(Set<String> productIds)
      The Product.getId() product IDs} matching the products for which ProductDetails are requested. If this field is non-null, then it is used instead of productUris.
      Parameters:
      uri - The Product.getId() product ID} matching the product for which ProductDetails are requested.
    • setVariantIds

      public void setVariantIds(Set<String> variantIds)
      The variant IDs matching the variants for which ProductDetails are requested. The parent Products of the resolved Variants will be resolved and returned in the ProductDetailsList.

      This is particularly useful when used in conjunction with variantHydrationBehavior to 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 which ProductDetails are 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 onto categories belonging to ItemChoice ProductOptions if 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 the ProductDetails response 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 the Characteristics for 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

      public void setVariantHydrationBehavior(String variantHydrationBehavior)
      Determines the behavior of the system with regard to hydrating Variants onto the ProductDetails for 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 by ProductDetailsProperties.getVariantHydrationBehavior().

      Note: Variants for the variantIds are 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

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setResolvedVariants

      public void setResolvedVariants(Set<Variant> resolvedVariants)
      The resolved Variants matching the variantIds.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • setProductIdsNotFound

      public void setProductIdsNotFound(Set<String> productIdsNotFound)
      The list of requested productIds that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • setVariantIdsNotFound

      public void setVariantIdsNotFound(Set<String> variantIdsNotFound)
      The list of requested variantIds that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • setProductUrisNotFound

      public void setProductUrisNotFound(Set<String> productUrisNotFound)
      The list of requested productUris that were not resolvable.
      Since:
      Catalog Service 2.3.0-GA, Release Train 2.3.0-GA
    • 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