Class DiscountOnTotalPriceBuilder

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

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

     DiscountOnTotalPrice discountOnTotalPrice = DiscountOnTotalPrice.builder()
             .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
             .plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
             .build()
 
  • Constructor Details

    • DiscountOnTotalPriceBuilder

      public DiscountOnTotalPriceBuilder()
  • Method Details

    • discountedAmount

      public DiscountOnTotalPriceBuilder discountedAmount(TypedMoney discountedAmount)

      Money value of the discount on the total price of the Cart or Order.

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

      public DiscountOnTotalPriceBuilder discountedAmount(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)

      Money value of the discount on the total price of the Cart or Order.

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

      public DiscountOnTotalPriceBuilder includedDiscounts(DiscountedTotalPricePortion... includedDiscounts)

      Discounts that impact the total price of the Cart or Order.

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

      public DiscountOnTotalPriceBuilder includedDiscounts(List<DiscountedTotalPricePortion> includedDiscounts)

      Discounts that impact the total price of the Cart or Order.

      Parameters:
      includedDiscounts - value to be set
      Returns:
      Builder
    • plusIncludedDiscounts

      public DiscountOnTotalPriceBuilder plusIncludedDiscounts(DiscountedTotalPricePortion... includedDiscounts)

      Discounts that impact the total price of the Cart or Order.

      Parameters:
      includedDiscounts - value to be set
      Returns:
      Builder
    • plusIncludedDiscounts

      Discounts that impact the total price of the Cart or Order.

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

      Discounts that impact the total price of the Cart or Order.

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

      Discounts that impact the total price of the Cart or Order.

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

      Discounts that impact the total price of the Cart or Order.

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

      public DiscountOnTotalPriceBuilder discountedNetAmount(@Nullable TypedMoney discountedNetAmount)

      Money value of the discount on the total net price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

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

      public DiscountOnTotalPriceBuilder discountedNetAmount(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)

      Money value of the discount on the total net price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

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

      public DiscountOnTotalPriceBuilder discountedGrossAmount(@Nullable TypedMoney discountedGrossAmount)

      Money value of the discount on the total gross price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

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

      public DiscountOnTotalPriceBuilder discountedGrossAmount(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)

      Money value of the discount on the total gross price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

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

      public TypedMoney getDiscountedAmount()

      Money value of the discount on the total price of the Cart or Order.

      Returns:
      discountedAmount
    • getIncludedDiscounts

      public List<DiscountedTotalPricePortion> getIncludedDiscounts()

      Discounts that impact the total price of the Cart or Order.

      Returns:
      includedDiscounts
    • getDiscountedNetAmount

      @Nullable public TypedMoney getDiscountedNetAmount()

      Money value of the discount on the total net price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

      Returns:
      discountedNetAmount
    • getDiscountedGrossAmount

      @Nullable public TypedMoney getDiscountedGrossAmount()

      Money value of the discount on the total gross price of the Cart or Order.

      The same percentage of discount applies as on the discountedAmount. Present only when taxedPrice of the Cart or Order exists.

      Returns:
      discountedGrossAmount
    • build

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

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

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

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