Class MyCartRemoveLineItemActionBuilder

java.lang.Object
com.commercetools.api.models.me.MyCartRemoveLineItemActionBuilder
All Implemented Interfaces:
Builder<MyCartRemoveLineItemAction>

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

     MyCartRemoveLineItemAction myCartRemoveLineItemAction = MyCartRemoveLineItemAction.builder()
             .build()
 
  • Constructor Details

    • MyCartRemoveLineItemActionBuilder

      public MyCartRemoveLineItemActionBuilder()
  • Method Details

    • lineItemId

      public MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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 MyCartRemoveLineItemActionBuilder 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

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

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

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

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