Class UpdateItemRequest
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.web.endpoint.domain.CartItemModifyingRequest
-
- com.broadleafcommerce.cartoperation.web.endpoint.domain.UpdateItemRequest
-
- All Implemented Interfaces:
CartVersionedRequest,Serializable
public class UpdateItemRequest extends CartItemModifyingRequest implements Serializable
A request DTO for updating a cart item. This is passed throughCartOperationService#updateCartItem(Cart, String, UpdateItemRequest, boolean)and is used to inform the update of aCartItem.- Author:
- Chris Kittrell (ckittrell), Chad Harchar (charchar)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UpdateItemRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)Map<String,Object>getCartAttributes()Attributes that should be copied to theCart.getAttributes()for this request.StringgetCartItemId()ID of theCartItemto update.List<UpdateItemRequest>getDependentItemUpdates()A list of additionalAddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.Map<String,String>getItemAttributeChoices()Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.Map<String,Object>getItemAttributes()Attributes that should be copied to theCartItem.getAttributes()for this request.StringgetParentCartItemId()The id of the parentCartItemfor this add item request.intgetQuantity()The amount of this item to be added to theCart.StringgetVariantId()The id of the variant for this add item request.inthashCode()voidsetCartAttributes(Map<String,Object> cartAttributes)Attributes that should be copied to theCart.getAttributes()for this request.voidsetCartItemId(String cartItemId)ID of theCartItemto update.voidsetDependentItemUpdates(List<UpdateItemRequest> dependentItemUpdates)A list of additionalAddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.voidsetItemAttributeChoices(Map<String,String> itemAttributeChoices)Attribute choices that should be copied toCartItem.getAttributeChoices()for this request.voidsetItemAttributes(Map<String,Object> itemAttributes)Attributes that should be copied to theCartItem.getAttributes()for this request.voidsetParentCartItemId(String parentCartItemId)The id of the parentCartItemfor this add item request.voidsetQuantity(int quantity)The amount of this item to be added to theCart.voidsetVariantId(String variantId)The id of the variant for this add item request.StringtoString()-
Methods inherited from class com.broadleafcommerce.cartoperation.web.endpoint.domain.CartItemModifyingRequest
getCartVersion, setCartVersion
-
-
-
-
Method Detail
-
getCartItemId
public String getCartItemId()
ID of theCartItemto update.- Returns:
- ID of the
CartItemto update.
-
getVariantId
public String 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
public Map<String,Object> 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
public Map<String,String> 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
public Map<String,Object> 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
public List<UpdateItemRequest> getDependentItemUpdates()
A list of additionalAddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.- Returns:
- A list of additional
AddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.
-
getParentCartItemId
public String getParentCartItemId()
The id of the parentCartItemfor this add item request. This would create a childCartItemof the parent.- Returns:
- The id of the parent
CartItemfor this add item request. This would create a childCartItemof the parent.
-
setCartItemId
public void setCartItemId(String cartItemId)
ID of theCartItemto update.- Parameters:
cartItemId- ID of theCartItemto update.
-
setVariantId
public void setVariantId(String variantId)
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
public void setItemAttributes(Map<String,Object> itemAttributes)
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
public void setItemAttributeChoices(Map<String,String> itemAttributeChoices)
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
public void setCartAttributes(Map<String,Object> cartAttributes)
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
public void setDependentItemUpdates(List<UpdateItemRequest> dependentItemUpdates)
A list of additionalAddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.- Parameters:
childCartItems- A list of additionalAddItemRequeststhat should be processed as children items of the resulting parent item of this currentUpdateItemRequest.
-
setParentCartItemId
public void setParentCartItemId(String parentCartItemId)
The id of the parentCartItemfor this add item request. This would create a childCartItemof the parent.- Parameters:
parentCartItemId- The id of the parentCartItemfor this add item request. This would create a childCartItemof the parent.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classCartItemModifyingRequest
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqualin classCartItemModifyingRequest
-
hashCode
public int hashCode()
- Overrides:
hashCodein classCartItemModifyingRequest
-
toString
public String toString()
- Overrides:
toStringin classCartItemModifyingRequest
-
-