Class IncludedProduct

java.lang.Object
com.broadleafcommerce.cartoperation.domain.IncludedProduct
All Implemented Interfaces:
Serializable

public class IncludedProduct extends Object implements Serializable
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • IncludedProduct

      public IncludedProduct()
  • 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.
    • getValidationKey

      public String getValidationKey()
      Returns:
      The ID of the included item. By default, either the product or variant ID.
    • getType

      public String getType()
      Describes which of the product or variant fields should be used for this included product.
      Returns:
      the IncludedProductType of this included product
      See Also:
    • getLabel

      public String getLabel()
      The user-facing label that describes this included product.
      Returns:
      the user-facing label that describes this included product
    • getDisplayOrder

      public Long getDisplayOrder()
      Defines the display position of this included product in relation to other included products.
      Returns:
      the order in which this included product should be displayed relative to other included products
    • getProduct

      public Product getProduct()
      This field contains the specified product if the type is IncludedProductType.PRODUCT.
      Returns:
      the product to use if this included product is of type IncludedProductType.PRODUCT
    • getVariant

      public Variant getVariant()
      This field contains the specified variant if the type is IncludedProductType.VARIANT.
      Returns:
      the variant to use if this included product is of type IncludedProductType.VARIANT
      See Also:
      • variantParentProductId
    • getVariantParentProductId

      public String getVariantParentProductId()
      This field contains the id of the parent product of the specified variant if the type is IncludedProductType.VARIANT.

      This field is necessary because variants are a sub-resource of product and thus API callers cannot fetch them purely by variant id alone.

      Returns:
      the id of the parent product of the variant
      See Also:
      • variant
    • getAdditionalItemPricing

      public com.broadleafcommerce.cart.client.domain.AdditionalItemPricing getAdditionalItemPricing()
    • isDiscountAllowed

      public boolean isDiscountAllowed()
      Dictates whether or not discounts are allowed to be applied to this included product.
      Returns:
      true if discounts are allowed to be applied to this included product, false otherwise
    • getQuantity

      public int getQuantity()
      The value of the fixed quantity.
      Returns:
      the fixed quantity of the included product's target product(s) that can be added
    • getAttributes

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

      public void setType(String type)
      Describes which of the product or variant fields should be used for this included product.
      Parameters:
      type - the IncludedProductType of this included product
      See Also:
    • setLabel

      public void setLabel(String label)
      The user-facing label that describes this included product.
      Parameters:
      label - the user-facing label that describes this included product
    • setDisplayOrder

      public void setDisplayOrder(Long displayOrder)
      Defines the display position of this included product in relation to other included products.
      Parameters:
      displayOrder - the order in which this included product should be displayed relative to other included products
    • setProduct

      public void setProduct(Product product)
      This field contains the specified product if the type is IncludedProductType.PRODUCT.
      Parameters:
      product - the product to use if this included product is of type IncludedProductType.PRODUCT
    • setVariant

      public void setVariant(Variant variant)
      This field contains the specified variant if the type is IncludedProductType.VARIANT.
      Parameters:
      variant - the variant to use if this included product is of type IncludedProductType.VARIANT
      See Also:
      • variantParentProductId
    • setVariantParentProductId

      public void setVariantParentProductId(String variantParentProductId)
      This field contains the id of the parent product of the specified variant if the type is IncludedProductType.VARIANT.

      This field is necessary because variants are a sub-resource of product and thus API callers cannot fetch them purely by variant id alone.

      Parameters:
      variantParentProductId - the id of the parent product of the variant
      See Also:
      • variant
    • setAdditionalItemPricing

      public void setAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing)
    • setDiscountAllowed

      public void setDiscountAllowed(boolean discountAllowed)
      Dictates whether or not discounts are allowed to be applied to this included product.
      Parameters:
      discountAllowed - true if discounts are allowed to be applied to this included product, false otherwise
    • setQuantity

      public void setQuantity(int quantity)
      The value of the fixed quantity.
      Parameters:
      fixedQuantity - the fixed quantity of the included product's target product(s) that can be added
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • 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
    • getOverridePrice

      public javax.money.MonetaryAmount getOverridePrice()
    • getPricingKey

      public String getPricingKey()
    • getPricingTargetType

      public String getPricingTargetType()
    • setOverridePrice

      public void setOverridePrice(javax.money.MonetaryAmount overridePrice)
    • setPricingKey

      public void setPricingKey(String pricingKey)
    • setPricingTargetType

      public void setPricingTargetType(String pricingTargetType)