Class AddItemRequest
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.domain.CartModifyingRequest
com.broadleafcommerce.cartoperation.web.endpoint.domain.AddItemRequest
- All Implemented Interfaces:
CartVersionedRequest,Serializable
A request DTO for adding an item to a cart. This is passed through
CartOperationService.addItemToCart(Cart, AddItemRequest, boolean, ContextInfo) and is
used to inform the creation of a CartItem.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanMiscellaneous attributes that can be set to this request in order to inform business logic for adding aCartItem.Attributes that should be copied to theCart.getAttributes()for this request.javax.money.CurrencyUnitThis specifies the user's preferred currency for creating or pricing the cart.A list of additionalAddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.The reference to the inventory location where to verify the availability of this item.Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.Miscellaneous attributes that should be copied to theCartItem.getAttributes()for this request.If thisAddItemRequestis one withingetDependentCartItems(), this is the key to use to relate to thisCartItemto a configured product item choice.Miscellaneous internal attributes that should be copied to theCartItem.getInternalAttributes()for this request.Thetypeof this item (e.g.Deprecated.The value that should be mapped toCartItem.getMerchandisingContext().Additional request information for adding a non-catalog item to the cart.Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.The id of the product for this add item request.intThe amount of this item to be added to theCart.The frequency of the recurring period, e.g., if this is 1 andrecurringPeriodTypeis MONTHLY, then the recurring price should be charged every 1 month.The period type for the recurring price, e.g.getSku()The SKU code for the item (e.g., Product or Variant).The length of the term duration selected for the item, if any.The type of the term duration selected for the item, if any.The id of the variant for this add item request.inthashCode()voidsetAdditionalAttributes(Map<String, Object> additionalAttributes) Miscellaneous attributes that can be set to this request in order to inform business logic for adding aCartItem.voidsetCartAttributes(Map<String, Object> cartAttributes) Attributes that should be copied to theCart.getAttributes()for this request.voidsetCurrency(javax.money.CurrencyUnit currency) This specifies the user's preferred currency for creating or pricing the cart.voidsetDependentCartItems(List<AddItemRequest> dependentCartItems) A list of additionalAddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.voidsetInventoryLocationReference(String inventoryLocationReference) The reference to the inventory location where to verify the availability of this item.voidsetItemAttributeChoices(Map<String, String> itemAttributeChoices) Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.voidsetItemAttributes(Map<String, Object> itemAttributes) Miscellaneous attributes that should be copied to theCartItem.getAttributes()for this request.voidsetItemChoiceKey(String itemChoiceKey) If thisAddItemRequestis one withingetDependentCartItems(), this is the key to use to relate to thisCartItemto a configured product item choice.voidsetItemInternalAttributes(Map<String, Object> itemInternalAttributes) Miscellaneous internal attributes that should be copied to theCartItem.getInternalAttributes()for this request.voidsetItemType(String itemType) Thetypeof this item (e.g.voidDeprecated.in favor of usingPriceCartRequestfor creating or pricing a cart.voidsetMerchandisingContext(String merchandisingContext) The value that should be mapped toCartItem.getMerchandisingContext().voidsetNonCatalogItemDetails(NonCatalogItemDetails nonCatalogItemDetails) Additional request information for adding a non-catalog item to the cart.voidsetPaymentStrategy(String paymentStrategy) Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.voidsetProductId(String productId) The id of the product for this add item request.voidsetQuantity(int quantity) The amount of this item to be added to theCart.voidsetRecurringPeriodFrequency(Integer recurringPeriodFrequency) The frequency of the recurring period, e.g., if this is 1 andrecurringPeriodTypeis MONTHLY, then the recurring price should be charged every 1 month.voidsetRecurringPeriodType(String recurringPeriodType) The period type for the recurring price, e.g.voidThe SKU code for the item (e.g., Product or Variant).voidsetTermDurationLength(Integer termDurationLength) The length of the term duration selected for the item, if any.voidsetTermDurationType(String termDurationType) The type of the term duration selected for the item, if any.voidsetVariantId(String variantId) The id of the variant for this add item request.toString()Methods inherited from class com.broadleafcommerce.cartoperation.web.endpoint.domain.CartModifyingRequest
getCartVersion, getVersion, setCartVersion, setVersion
-
Constructor Details
-
AddItemRequest
public AddItemRequest()
-
-
Method Details
-
getVariantId
The id of the variant for this add item request. Used to retrieve variant information for the cart item.- Returns:
- The id of the variant for this add item request. Used to retrieve variant information for the cart item.
-
getProductId
The id of the product for this add item request. Used to retrieve product information for the cart item.- Returns:
- The id of the product for this add item request. Used to retrieve product information for the cart item.
-
getSku
The SKU code for the item (e.g., Product or Variant).- Returns:
- SKU code for the item
-
getItemType
Thetypeof this item (e.g. Standard or Custom Quote Item). Defaults toDefaultCartItemTypes.STANDARD.- Returns:
- type of this item
- See Also:
-
getNonCatalogItemDetails
Additional request information for adding a non-catalog item to the cart. For example, this can be useful for adding aDefaultCartItemTypes.CUSTOM_QUOTE_ITEMthat doesn't exist in the catalog. -
getQuantity
public int getQuantity()The amount of this item to be added to theCart.- Returns:
- The amount of this item to be added to the
Cart.
-
getCurrency
public javax.money.CurrencyUnit getCurrency()This specifies the user's preferred currency for creating or pricing the cart. It is passed from the front-end. This is ignored ifPriceCartRequestis present. -
getLocale
Deprecated.in favor of usingPriceCartRequestfor creating or pricing a cart. -
getItemAttributes
Miscellaneous attributes that should be copied to theCartItem.getAttributes()for this request.- Returns:
- Miscellaneous attributes that should be copied to the
CartItem.getAttributes()for this request.
-
getItemInternalAttributes
Miscellaneous internal attributes that should be copied to theCartItem.getInternalAttributes()for this request.- Returns:
- Miscellaneous internal attributes that should be copied to the
CartItem.getInternalAttributes()for this request.
-
getItemAttributeChoices
Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.- Returns:
- Attribute choices that should be copied to
CartItem.getAttributeChoices()for this request.
-
getCartAttributes
Attributes that should be copied to theCart.getAttributes()for this request.- Returns:
- Attributes that should be copied to the
Cart.getAttributes()for this request.
-
getDependentCartItems
A list of additionalAddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.- Returns:
- A list of additional
AddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.
-
getItemChoiceKey
If thisAddItemRequestis one withingetDependentCartItems(), this is the key to use to relate to thisCartItemto a configured product item choice.- Returns:
- The key to use to relate to this
CartItemto a configured product item choice.
-
getMerchandisingContext
The value that should be mapped toCartItem.getMerchandisingContext(). This holds the selector or merchandising product's id.- Returns:
- The context of the item signifying where it's added from
-
getAdditionalAttributes
Miscellaneous attributes that can be set to this request in order to inform business logic for adding aCartItem.- Returns:
- Miscellaneous attributes that can be set to this request in order to inform business
logic for adding a
CartItem.
-
getTermDurationType
The type of the term duration selected for the item, if any. Some items may have terms to allow certain pricing for the user. This indicates the type of duration, e.g., DAYS, WEEKS, MONTHS, YEARS, for the selected term. For example, choosing between paying the full price for a device (no terms) vs splitting payment over 36 months (termDurationLengthof 36 andtermDurationTypeof MONTHS).- Since:
- Cart Operation Service 2.2.0, Release Train 2.2.0
- See Also:
-
termDurationLength
-
getTermDurationLength
The length of the term duration selected for the item, if any. Some items may have terms to allow certain pricing for the user. This indicates the length of duration for the selected term. For example, choosing between paying the full price for a device (no terms) vs splitting payment over 36 months (termDurationLengthof 36 andtermDurationTypeof MONTHS).- Since:
- Cart Operation Service 2.2.0, Release Train 2.2.0
- See Also:
-
termDurationType
-
getRecurringPeriodFrequency
The frequency of the recurring period, e.g., if this is 1 andrecurringPeriodTypeis MONTHLY, then the recurring price should be charged every 1 month.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- See Also:
-
recurringPeriodType
-
getRecurringPeriodType
The period type for the recurring price, e.g. MONTHLY, QUARTERLY, ANNUALLY.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- See Also:
-
recurringPeriodFrequency
-
getPaymentStrategy
Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
getInventoryLocationReference
The reference to the inventory location where to verify the availability of this item.- Since:
- Cart Operation Service 2.2.1, Release Train 2.2.1
-
setVariantId
The id of the variant for this add item request. Used to retrieve variant information for the cart item.- Parameters:
variantId- The id of the variant for this add item request. Used to retrieve variant information for the cart item.
-
setProductId
The id of the product for this add item request. Used to retrieve product information for the cart item.- Parameters:
productId- The id of the product for this add item request. Used to retrieve product information for the cart item.
-
setSku
The SKU code for the item (e.g., Product or Variant).- Parameters:
sku- SKU code for the item
-
setItemType
Thetypeof this item (e.g. Standard or Custom Quote Item). Defaults toDefaultCartItemTypes.STANDARD.- Parameters:
type- type of this item- See Also:
-
setNonCatalogItemDetails
Additional request information for adding a non-catalog item to the cart. For example, this can be useful for adding aDefaultCartItemTypes.CUSTOM_QUOTE_ITEMthat doesn't exist in the catalog. -
setQuantity
public void setQuantity(int quantity) The amount of this item to be added to theCart.- Parameters:
quantity- The amount of this item to be added to theCart.
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) This specifies the user's preferred currency for creating or pricing the cart. It is passed from the front-end. This is ignored ifPriceCartRequestis present. -
setLocale
Deprecated.in favor of usingPriceCartRequestfor creating or pricing a cart. -
setItemAttributes
Miscellaneous attributes that should be copied to theCartItem.getAttributes()for this request.- Parameters:
itemAttributes- Miscellaneous attributes that should be copied to theCartItem.getAttributes()for this request.
-
setItemInternalAttributes
Miscellaneous internal attributes that should be copied to theCartItem.getInternalAttributes()for this request.- Parameters:
itemAttributes- Miscellaneous internal attributes that should be copied to theCartItem.getInternalAttributes()for this request.
-
setItemAttributeChoices
Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.- Parameters:
itemAttributeChoices- Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.
-
setCartAttributes
Attributes that should be copied to theCart.getAttributes()for this request.- Parameters:
cartAttributes- Attributes that should be copied to theCart.getAttributes()for this request.
-
setDependentCartItems
A list of additionalAddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.- Parameters:
dependentCartItems- A list of additionalAddItemRequeststhat should be processed as dependent items of the resulting parent item of this currentAddItemRequest.
-
setItemChoiceKey
If thisAddItemRequestis one withingetDependentCartItems(), this is the key to use to relate to thisCartItemto a configured product item choice.- Parameters:
itemChoiceKey- The key to use to relate to thisCartItemto a configured product item choice.
-
setMerchandisingContext
The value that should be mapped toCartItem.getMerchandisingContext(). This holds the selector or merchandising product's id.- Parameters:
merchandisingContext- The context of the item signifying where it's added from
-
setAdditionalAttributes
Miscellaneous attributes that can be set to this request in order to inform business logic for adding aCartItem.- Parameters:
additionalAttributes- Miscellaneous attributes that can be set to this request in order to inform business logic for adding aCartItem.
-
setTermDurationType
The type of the term duration selected for the item, if any. Some items may have terms to allow certain pricing for the user. This indicates the type of duration, e.g., DAYS, WEEKS, MONTHS, YEARS, for the selected term. For example, choosing between paying the full price for a device (no terms) vs splitting payment over 36 months (termDurationLengthof 36 andtermDurationTypeof MONTHS).- Since:
- Cart Operation Service 2.2.0, Release Train 2.2.0
- See Also:
-
termDurationLength
-
setTermDurationLength
The length of the term duration selected for the item, if any. Some items may have terms to allow certain pricing for the user. This indicates the length of duration for the selected term. For example, choosing between paying the full price for a device (no terms) vs splitting payment over 36 months (termDurationLengthof 36 andtermDurationTypeof MONTHS).- Since:
- Cart Operation Service 2.2.0, Release Train 2.2.0
- See Also:
-
termDurationType
-
setRecurringPeriodFrequency
The frequency of the recurring period, e.g., if this is 1 andrecurringPeriodTypeis MONTHLY, then the recurring price should be charged every 1 month.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- See Also:
-
recurringPeriodType
-
setRecurringPeriodType
The period type for the recurring price, e.g. MONTHLY, QUARTERLY, ANNUALLY.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- See Also:
-
recurringPeriodFrequency
-
setPaymentStrategy
Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setInventoryLocationReference
The reference to the inventory location where to verify the availability of this item.- Since:
- Cart Operation Service 2.2.1, Release Train 2.2.1
-
equals
- Overrides:
equalsin classCartModifyingRequest
-
canEqual
- Overrides:
canEqualin classCartModifyingRequest
-
hashCode
public int hashCode()- Overrides:
hashCodein classCartModifyingRequest
-
toString
- Overrides:
toStringin classCartModifyingRequest
-
PriceCartRequestfor creating or pricing a cart.