Class CartDiscountValueRelativeDraftBuilder

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

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

     CartDiscountValueRelativeDraft cartDiscountValueRelativeDraft = CartDiscountValueRelativeDraft.builder()
             .permyriad(0.3)
             .build()
 
  • Constructor Details

    • CartDiscountValueRelativeDraftBuilder

      public CartDiscountValueRelativeDraftBuilder()
  • Method Details

    • permyriad

      public CartDiscountValueRelativeDraftBuilder permyriad(Long permyriad)

      Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

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

      public CartDiscountValueRelativeDraftBuilder applicationMode(@Nullable DiscountApplicationMode applicationMode)

      Determines how the discount applies when using CartDiscountPatternTarget.

      • If the mode is IndividualApplication, the discounted percentage is applied on each unit's price. The units matching the triggerPattern are not considered.
      • If the mode is ProportionateDistribution and EvenDistribution the discounted value is calculated from the total value of the units matching the targetPattern and distributed among the units matching the targetPattern or triggerPattern. These modes are allowed only if CartDiscountPatternTarget triggerPattern is non-empty.
      Parameters:
      applicationMode - value to be set
      Returns:
      Builder
    • getPermyriad

      public Long getPermyriad()

      Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

      Returns:
      permyriad
    • getApplicationMode

      @Nullable public DiscountApplicationMode getApplicationMode()

      Determines how the discount applies when using CartDiscountPatternTarget.

      • If the mode is IndividualApplication, the discounted percentage is applied on each unit's price. The units matching the triggerPattern are not considered.
      • If the mode is ProportionateDistribution and EvenDistribution the discounted value is calculated from the total value of the units matching the targetPattern and distributed among the units matching the targetPattern or triggerPattern. These modes are allowed only if CartDiscountPatternTarget triggerPattern is non-empty.
      Returns:
      applicationMode
    • build

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

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

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

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