Class CartChangeLineItemQuantityActionBuilder

java.lang.Object
com.commercetools.api.models.cart.CartChangeLineItemQuantityActionBuilder
All Implemented Interfaces:
Builder<CartChangeLineItemQuantityAction>

public class CartChangeLineItemQuantityActionBuilder extends Object implements Builder<CartChangeLineItemQuantityAction>
CartChangeLineItemQuantityActionBuilder
Example to create an instance using the builder pattern

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

    • CartChangeLineItemQuantityActionBuilder

      public CartChangeLineItemQuantityActionBuilder()
  • Method Details

    • lineItemId

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

      Parameters:
      lineItemId - value to be set
      Returns:
      Builder
    • lineItemKey

      public CartChangeLineItemQuantityActionBuilder lineItemKey(@Nullable String lineItemKey)

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

      Parameters:
      lineItemKey - value to be set
      Returns:
      Builder
    • quantity

      public CartChangeLineItemQuantityActionBuilder quantity(Long quantity)

      New value to set.

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

      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • 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:
      builder - function to build the externalPrice value
      Returns:
      Builder
    • withExternalPrice

      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:
      builder - function to build the externalPrice value
      Returns:
      Builder
    • externalPrice

      public CartChangeLineItemQuantityActionBuilder externalPrice(@Nullable 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
      Returns:
      Builder
    • externalTotalPrice

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

      Parameters:
      builder - function to build the externalTotalPrice value
      Returns:
      Builder
    • withExternalTotalPrice

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

      Parameters:
      builder - function to build the externalTotalPrice value
      Returns:
      Builder
    • externalTotalPrice

      public CartChangeLineItemQuantityActionBuilder externalTotalPrice(@Nullable 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
      Returns:
      Builder
    • getLineItemId

      @Nullable public String getLineItemId()

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

      Returns:
      lineItemId
    • getLineItemKey

      @Nullable public String getLineItemKey()

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

      Returns:
      lineItemKey
    • getQuantity

      public Long getQuantity()

      New value to set.

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

      Returns:
      quantity
    • getExternalPrice

      @Nullable public 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

      @Nullable public 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
    • build

      builds CartChangeLineItemQuantityAction with checking for non-null required values
      Specified by:
      build in interface Builder<CartChangeLineItemQuantityAction>
      Returns:
      CartChangeLineItemQuantityAction
    • buildUnchecked

      public CartChangeLineItemQuantityAction buildUnchecked()
      builds CartChangeLineItemQuantityAction without checking for non-null required values
      Returns:
      CartChangeLineItemQuantityAction
    • of

      factory method for an instance of CartChangeLineItemQuantityActionBuilder
      Returns:
      builder
    • of

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