Class UpdateItemRequest
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.domain.CartItemModifyingRequest
com.broadleafcommerce.cartoperation.web.endpoint.domain.UpdateItemRequest
- All Implemented Interfaces:
CartVersionedRequest
,Serializable
A request DTO for updating a cart item. This is passed through
CartOperationService#updateCartItem(Cart, String, UpdateItemRequest, boolean)
and is used
to inform the update of a CartItem
.- Author:
- Chris Kittrell (ckittrell), Chad Harchar (charchar)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Miscellaneous attributes that can be set to this request in order to inform business logic for updating aCartItem
.Attributes that should be copied to theCart.getAttributes()
for this request.ID of theCartItem
to update.A list of additionalAddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.Attribute choices that should be copied toCartItem.getAttributeChoices()
for this request.Attributes that should be copied to theCartItem.getAttributes()
for this request.The id of the parentCartItem
for this add item request.int
The amount of this item to be added to theCart
.The id of the variant for this add item request.int
hashCode()
void
setAdditionalAttributes
(Map<String, Object> additionalAttributes) Miscellaneous attributes that can be set to this request in order to inform business logic for updating aCartItem
.void
setCartAttributes
(Map<String, Object> cartAttributes) Attributes that should be copied to theCart.getAttributes()
for this request.void
setCartItemId
(String cartItemId) ID of theCartItem
to update.void
setDependentItemUpdates
(List<UpdateItemRequest> dependentItemUpdates) A list of additionalAddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.void
setItemAttributeChoices
(Map<String, String> itemAttributeChoices) Attribute choices that should be copied toCartItem.getAttributeChoices()
for this request.void
setItemAttributes
(Map<String, Object> itemAttributes) Attributes that should be copied to theCartItem.getAttributes()
for this request.void
setParentCartItemId
(String parentCartItemId) The id of the parentCartItem
for this add item request.void
setQuantity
(int quantity) The amount of this item to be added to theCart
.void
setVariantId
(String variantId) The id of the variant for this add item request.toString()
Methods inherited from class com.broadleafcommerce.cartoperation.web.endpoint.domain.CartItemModifyingRequest
getCartVersion, setCartVersion
-
Constructor Details
-
UpdateItemRequest
public UpdateItemRequest()
-
-
Method Details
-
getCartItemId
ID of theCartItem
to update.- Returns:
- ID of the
CartItem
to update.
-
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.
-
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
.
-
getItemAttributes
Attributes that should be copied to theCartItem.getAttributes()
for this request.- Returns:
- Attributes that should be copied to the
CartItem.getAttributes()
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.
-
getDependentItemUpdates
A list of additionalAddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.- Returns:
- A list of additional
AddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.
-
getParentCartItemId
The id of the parentCartItem
for this add item request. This would create a childCartItem
of the parent.- Returns:
- The id of the parent
CartItem
for this add item request. This would create a childCartItem
of the parent.
-
getAdditionalAttributes
Miscellaneous attributes that can be set to this request in order to inform business logic for updating aCartItem
.- Returns:
- Miscellaneous attributes that can be set to this request in order to inform business
logic for updating a
CartItem
.
-
setCartItemId
ID of theCartItem
to update.- Parameters:
cartItemId
- ID of theCartItem
to update.
-
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.
-
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
.
-
setItemAttributes
Attributes that should be copied to theCartItem.getAttributes()
for this request.- Parameters:
itemAttributes
- Attributes that should be copied to theCartItem.getAttributes()
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.
-
setDependentItemUpdates
A list of additionalAddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.- Parameters:
childCartItems
- A list of additionalAddItemRequests
that should be processed as children items of the resulting parent item of this currentUpdateItemRequest
.
-
setParentCartItemId
The id of the parentCartItem
for this add item request. This would create a childCartItem
of the parent.- Parameters:
parentCartItemId
- The id of the parentCartItem
for this add item request. This would create a childCartItem
of the parent.
-
setAdditionalAttributes
Miscellaneous attributes that can be set to this request in order to inform business logic for updating aCartItem
.- Parameters:
additionalAttributes
- Miscellaneous attributes that can be set to this request in order to inform business logic for updating aCartItem
.
-
equals
- Overrides:
equals
in classCartItemModifyingRequest
-
canEqual
- Overrides:
canEqual
in classCartItemModifyingRequest
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCartItemModifyingRequest
-
toString
- Overrides:
toString
in classCartItemModifyingRequest
-