Class CartSetLineItemPriceActionBuilder

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

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

     CartSetLineItemPriceAction cartSetLineItemPriceAction = CartSetLineItemPriceAction.builder()
             .build()
 
  • Constructor Details

    • CartSetLineItemPriceActionBuilder

      public CartSetLineItemPriceActionBuilder()
  • Method Details

    • lineItemId

      public CartSetLineItemPriceActionBuilder 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 CartSetLineItemPriceActionBuilder lineItemKey(@Nullable String lineItemKey)

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

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

      Value to set. If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

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

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

      Value to set. If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

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

      public CartSetLineItemPriceActionBuilder externalPrice(@Nullable Money externalPrice)

      Value to set. If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

      Parameters:
      externalPrice - 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
    • getExternalPrice

      @Nullable public Money getExternalPrice()

      Value to set. If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

      Returns:
      externalPrice
    • build

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

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

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

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