Class CartDiscountValueFixedBuilder

java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountValueFixedBuilder
All Implemented Interfaces:
Builder<CartDiscountValueFixed>

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

     CartDiscountValueFixed cartDiscountValueFixed = CartDiscountValueFixed.builder()
             .plusMoney(moneyBuilder -> moneyBuilder)
             .build()
 
  • Constructor Details

    • CartDiscountValueFixedBuilder

      public CartDiscountValueFixedBuilder()
  • Method Details

    • money

      public CartDiscountValueFixedBuilder money(TypedMoney... money)

      Money values in cent precision or high precision of different currencies.

      Parameters:
      money - value to be set
      Returns:
      Builder
    • money

      Money values in cent precision or high precision of different currencies.

      Parameters:
      money - value to be set
      Returns:
      Builder
    • plusMoney

      public CartDiscountValueFixedBuilder plusMoney(TypedMoney... money)

      Money values in cent precision or high precision of different currencies.

      Parameters:
      money - value to be set
      Returns:
      Builder
    • plusMoney

      Money values in cent precision or high precision of different currencies.

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

      Money values in cent precision or high precision of different currencies.

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

      public CartDiscountValueFixedBuilder applicationMode(@Nullable DiscountApplicationMode applicationMode)

      Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

      For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

      Parameters:
      applicationMode - value to be set
      Returns:
      Builder
    • getMoney

      public List<TypedMoney> getMoney()

      Money values in cent precision or high precision of different currencies.

      Returns:
      money
    • getApplicationMode

      @Nullable public DiscountApplicationMode getApplicationMode()

      Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

      For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

      Returns:
      applicationMode
    • build

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

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

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

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