Interface CartChangeLineItemQuantityAction

All Superinterfaces:
CartUpdateAction, ResourceUpdateAction<CartUpdateAction>

public interface CartChangeLineItemQuantityAction extends CartUpdateAction

When multiple shipping addresses are set for a Line Item, use the Remove LineItem and Add LineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Line Item quantity should be distributed over the sub-quantities, the shippingDetails field is kept in its current state to avoid data loss.

To change the Line Item quantity and shipping details together, use this update action in combination with the Set LineItem ShippingDetails update action in a single Cart update command.

The LineItem price is set as described in LineItem Price selection.


Example to create an instance using the builder pattern

     CartChangeLineItemQuantityAction cartChangeLineItemQuantityAction = CartChangeLineItemQuantityAction.builder()
             .quantity(0.3)
             .build()
 
  • Field Details

    • CHANGE_LINE_ITEM_QUANTITY

      static final String CHANGE_LINE_ITEM_QUANTITY
      discriminator value for CartChangeLineItemQuantityAction
      See Also:
  • Method Details

    • getLineItemId

      String getLineItemId()

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemId
    • getLineItemKey

      String getLineItemKey()

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemKey
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      New value to set.

      If 0, the Line Item is removed from the Cart.

      Returns:
      quantity
    • getExternalPrice

      @Valid @Valid Money getExternalPrice()

      Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

      The LineItem price is updated as described in LineItem Price selection.

      Returns:
      externalPrice
    • getExternalTotalPrice

      @Valid @Valid ExternalLineItemTotalPrice getExternalTotalPrice()

      Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

      Returns:
      externalTotalPrice
    • setLineItemId

      void setLineItemId(String lineItemId)

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemId - value to be set
    • setLineItemKey

      void setLineItemKey(String lineItemKey)

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemKey - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      New value to set.

      If 0, the Line Item is removed from the Cart.

      Parameters:
      quantity - value to be set
    • setExternalPrice

      void setExternalPrice(Money externalPrice)

      Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

      The LineItem price is updated as described in LineItem Price selection.

      Parameters:
      externalPrice - value to be set
    • setExternalTotalPrice

      void setExternalTotalPrice(ExternalLineItemTotalPrice externalTotalPrice)

      Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

      Parameters:
      externalTotalPrice - value to be set
    • of

      factory method
      Returns:
      instance of CartChangeLineItemQuantityAction
    • of

      factory method to create a shallow copy CartChangeLineItemQuantityAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of CartChangeLineItemQuantityAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for CartChangeLineItemQuantityAction
      Returns:
      builder
    • builder

      create builder for CartChangeLineItemQuantityAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartChangeLineItemQuantityAction

      default <T> T withCartChangeLineItemQuantityAction(Function<CartChangeLineItemQuantityAction,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<CartChangeLineItemQuantityAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference