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 through CartOperationService.updateItemInCart(Cart, UpdateItemRequest, boolean, ContextInfo) and is used to inform the update of a CartItem.
Author:
Chris Kittrell (ckittrell), Chad Harchar (charchar)
See Also:
  • Constructor Details

    • UpdateItemRequest

      public UpdateItemRequest()
  • Method Details

    • getCartItemId

      public String getCartItemId()
      ID of the CartItem to update.
      Returns:
      ID of the CartItem to 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 the Cart.
      Returns:
      The amount of this item to be added to the Cart.
    • getItemAttributes

      public Map<String,Object> getItemAttributes()
      Attributes that should be copied to the CartItem.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 to CartItem.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 the Cart.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 additional AddItemRequests that should be processed as children items of the resulting parent item of this current UpdateItemRequest.
      Returns:
      A list of additional AddItemRequests that should be processed as children items of the resulting parent item of this current UpdateItemRequest.
    • getDependentItemsToAdd

      public List<AddItemRequest> getDependentItemsToAdd()
      A list of additional AddItemRequests that should be added as children items of the resulting parent item of this current UpdateItemRequest.
      Since:
      Cart Operation Service 2.3.0, Release Train 2.3.0
    • getDependentItemsToRemove

      public List<String> getDependentItemsToRemove()
      A list of additional cartItemIds that should be removed as children items of the resulting parent item of this current UpdateItemRequest.
      Since:
      Cart Operation Service 2.3.0, Release Train 2.3.0
    • getParentCartItemId

      public String getParentCartItemId()
      The id of the parent CartItem for this add item request. This would create a child CartItem of the parent.
      Returns:
      The id of the parent CartItem for this add item request. This would create a child CartItem of the parent.
    • getRecurringPeriodFrequency

      public Integer getRecurringPeriodFrequency()
      The frequency of the recurring period, e.g., if this is 1 and recurringPeriodType is 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

      public String 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
    • getAdditionalAttributes

      public Map<String,Object> getAdditionalAttributes()
      Miscellaneous attributes that can be set to this request in order to inform business logic for updating a CartItem.
      Returns:
      Miscellaneous attributes that can be set to this request in order to inform business logic for updating a CartItem.
    • setCartItemId

      public void setCartItemId(String cartItemId)
      ID of the CartItem to update.
      Parameters:
      cartItemId - ID of the CartItem to 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 the Cart.
      Parameters:
      quantity - The amount of this item to be added to the Cart.
    • setItemAttributes

      public void setItemAttributes(Map<String,Object> itemAttributes)
      Attributes that should be copied to the CartItem.getAttributes() for this request.
      Parameters:
      itemAttributes - Attributes that should be copied to the CartItem.getAttributes() for this request.
    • setItemAttributeChoices

      public void setItemAttributeChoices(Map<String,String> itemAttributeChoices)
      Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
      Parameters:
      itemAttributeChoices - Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
    • setCartAttributes

      public void setCartAttributes(Map<String,Object> cartAttributes)
      Attributes that should be copied to the Cart.getAttributes() for this request.
      Parameters:
      cartAttributes - Attributes that should be copied to the Cart.getAttributes() for this request.
    • setDependentItemUpdates

      public void setDependentItemUpdates(List<UpdateItemRequest> dependentItemUpdates)
      A list of additional AddItemRequests that should be processed as children items of the resulting parent item of this current UpdateItemRequest.
      Parameters:
      childCartItems - A list of additional AddItemRequests that should be processed as children items of the resulting parent item of this current UpdateItemRequest.
    • setDependentItemsToAdd

      public void setDependentItemsToAdd(List<AddItemRequest> dependentItemsToAdd)
      A list of additional AddItemRequests that should be added as children items of the resulting parent item of this current UpdateItemRequest.
      Since:
      Cart Operation Service 2.3.0, Release Train 2.3.0
    • setDependentItemsToRemove

      public void setDependentItemsToRemove(List<String> dependentItemsToRemove)
      A list of additional cartItemIds that should be removed as children items of the resulting parent item of this current UpdateItemRequest.
      Since:
      Cart Operation Service 2.3.0, Release Train 2.3.0
    • setParentCartItemId

      public void setParentCartItemId(String parentCartItemId)
      The id of the parent CartItem for this add item request. This would create a child CartItem of the parent.
      Parameters:
      parentCartItemId - The id of the parent CartItem for this add item request. This would create a child CartItem of the parent.
    • setRecurringPeriodFrequency

      public void setRecurringPeriodFrequency(Integer recurringPeriodFrequency)
      The frequency of the recurring period, e.g., if this is 1 and recurringPeriodType is 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

      public void setRecurringPeriodType(String recurringPeriodType)
      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
    • setAdditionalAttributes

      public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
      Miscellaneous attributes that can be set to this request in order to inform business logic for updating a CartItem.
      Parameters:
      additionalAttributes - Miscellaneous attributes that can be set to this request in order to inform business logic for updating a CartItem.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class CartItemModifyingRequest
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class CartItemModifyingRequest
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CartItemModifyingRequest
    • toString

      public String toString()
      Overrides:
      toString in class CartItemModifyingRequest