Class CartSetDirectDiscountsActionBuilder

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

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

     CartSetDirectDiscountsAction cartSetDirectDiscountsAction = CartSetDirectDiscountsAction.builder()
             .plusDiscounts(discountsBuilder -> discountsBuilder)
             .build()
 
  • Constructor Details

    • CartSetDirectDiscountsActionBuilder

      public CartSetDirectDiscountsActionBuilder()
  • Method Details

    • discounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      discounts - value to be set
      Returns:
      Builder
    • discounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      discounts - value to be set
      Returns:
      Builder
    • plusDiscounts

      public CartSetDirectDiscountsActionBuilder plusDiscounts(DirectDiscountDraft... discounts)
      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      discounts - value to be set
      Returns:
      Builder
    • plusDiscounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      builder - function to build the discounts value
      Returns:
      Builder
    • withDiscounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      builder - function to build the discounts value
      Returns:
      Builder
    • addDiscounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      builder - function to build the discounts value
      Returns:
      Builder
    • setDiscounts

      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Parameters:
      builder - function to build the discounts value
      Returns:
      Builder
    • getDiscounts

      public List<DirectDiscountDraft> getDiscounts()
      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
      Returns:
      discounts
    • build

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

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

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

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