Class StagedOrderChangeLineItemQuantityActionBuilder

java.lang.Object
com.commercetools.api.models.order_edit.StagedOrderChangeLineItemQuantityActionBuilder
All Implemented Interfaces:
Builder<StagedOrderChangeLineItemQuantityAction>

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

     StagedOrderChangeLineItemQuantityAction stagedOrderChangeLineItemQuantityAction = StagedOrderChangeLineItemQuantityAction.builder()
             .quantity(0.3)
             .build()
 
  • Constructor Details

    • StagedOrderChangeLineItemQuantityActionBuilder

      public StagedOrderChangeLineItemQuantityActionBuilder()
  • Method Details

    • lineItemId

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

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

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

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

      New value to set. If 0, the LineItem is removed from the Order.

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

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

      The LineItem price is updated as described in Line Item price selection.

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

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

      The LineItem price is updated as described in Line Item price selection.

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

      public StagedOrderChangeLineItemQuantityActionBuilder externalPrice(@Nullable Money externalPrice)

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

      The LineItem price is updated as described in Line Item 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. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

      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. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

      Parameters:
      builder - function to build the externalTotalPrice value
      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. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

      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 LineItem is removed from the Order.

      Returns:
      quantity
    • getExternalPrice

      @Nullable public Money getExternalPrice()

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

      The LineItem price is updated as described in Line Item 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. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

      Returns:
      externalTotalPrice
    • build

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

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

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

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