Class CartRemoveLineItemActionBuilder

java.lang.Object
com.commercetools.api.models.cart.CartRemoveLineItemActionBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<CartRemoveLineItemAction>

public class CartRemoveLineItemActionBuilder extends Object implements io.vrap.rmf.base.client.Builder<CartRemoveLineItemAction>
CartRemoveLineItemActionBuilder
Example to create an instance using the builder pattern

     CartRemoveLineItemAction cartRemoveLineItemAction = CartRemoveLineItemAction.builder()
             .build()
 
  • Constructor Details

    • CartRemoveLineItemActionBuilder

      public CartRemoveLineItemActionBuilder()
  • Method Details

    • lineItemId

      public CartRemoveLineItemActionBuilder lineItemId(@Nullable String lineItemId)

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

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

      public CartRemoveLineItemActionBuilder 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 CartRemoveLineItemActionBuilder quantity(@Nullable Long quantity)

      Amount to subtract from the LineItem's quantity. If absent, the LineItem is removed from the Cart.

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

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

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

      public CartRemoveLineItemActionBuilder withExternalPrice(Function<MoneyBuilder,Money> builder)

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

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

      public CartRemoveLineItemActionBuilder externalPrice(@Nullable Money externalPrice)

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

      Parameters:
      externalPrice - value to be set
      Returns:
      Builder
    • externalTotalPrice

      Sets the LineItem price and totalPrice to the given value when decreasing 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 decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

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

      public CartRemoveLineItemActionBuilder externalTotalPrice(@Nullable ExternalLineItemTotalPrice externalTotalPrice)

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

      Parameters:
      externalTotalPrice - value to be set
      Returns:
      Builder
    • shippingDetailsToRemove

      Container for Line Item-specific addresses to remove.

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

      Container for Line Item-specific addresses to remove.

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

      public CartRemoveLineItemActionBuilder shippingDetailsToRemove(@Nullable ItemShippingDetailsDraft shippingDetailsToRemove)

      Container for Line Item-specific addresses to remove.

      Parameters:
      shippingDetailsToRemove - 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

      @Nullable public Long getQuantity()

      Amount to subtract from the LineItem's quantity. If absent, the LineItem is removed from the Cart.

      Returns:
      quantity
    • getExternalPrice

      @Nullable public Money getExternalPrice()

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

      Returns:
      externalPrice
    • getExternalTotalPrice

      @Nullable public ExternalLineItemTotalPrice getExternalTotalPrice()

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

      Returns:
      externalTotalPrice
    • getShippingDetailsToRemove

      @Nullable public ItemShippingDetailsDraft getShippingDetailsToRemove()

      Container for Line Item-specific addresses to remove.

      Returns:
      shippingDetailsToRemove
    • build

      public CartRemoveLineItemAction build()
      builds CartRemoveLineItemAction with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<CartRemoveLineItemAction>
      Returns:
      CartRemoveLineItemAction
    • buildUnchecked

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

      public static CartRemoveLineItemActionBuilder of()
      factory method for an instance of CartRemoveLineItemActionBuilder
      Returns:
      builder
    • of

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