Class MultiBuyCustomLineItemsTargetBuilder

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

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

     MultiBuyCustomLineItemsTarget multiBuyCustomLineItemsTarget = MultiBuyCustomLineItemsTarget.builder()
             .predicate("{predicate}")
             .triggerQuantity(1)
             .discountedQuantity(1)
             .selectionMode(SelectionMode.CHEAPEST)
             .build()
 
  • Constructor Details

    • MultiBuyCustomLineItemsTargetBuilder

      public MultiBuyCustomLineItemsTargetBuilder()
  • Method Details

    • predicate

      public MultiBuyCustomLineItemsTargetBuilder predicate(String predicate)

      Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.

      Parameters:
      predicate - value to be set
      Returns:
      Builder
    • triggerQuantity

      public MultiBuyCustomLineItemsTargetBuilder triggerQuantity(Integer triggerQuantity)

      Number of Custom Line Items to be present in order to trigger an application of this Discount.

      Parameters:
      triggerQuantity - value to be set
      Returns:
      Builder
    • discountedQuantity

      public MultiBuyCustomLineItemsTargetBuilder discountedQuantity(Integer discountedQuantity)

      Number of Custom Line Items that are discounted per application of this Discount. It must be less than or equal to the triggerQuantity.

      Parameters:
      discountedQuantity - value to be set
      Returns:
      Builder
    • maxOccurrence

      public MultiBuyCustomLineItemsTargetBuilder maxOccurrence(@Nullable Integer maxOccurrence)

      Maximum number of times this Discount can be applied. Do not set if the Discount should be applied an unlimited number of times.

      Parameters:
      maxOccurrence - value to be set
      Returns:
      Builder
    • selectionMode

      public MultiBuyCustomLineItemsTargetBuilder selectionMode(SelectionMode selectionMode)

      Discounts particular Line Items only according to the SelectionMode.

      Parameters:
      selectionMode - value to be set
      Returns:
      Builder
    • getPredicate

      public String getPredicate()

      Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.

      Returns:
      predicate
    • getTriggerQuantity

      public Integer getTriggerQuantity()

      Number of Custom Line Items to be present in order to trigger an application of this Discount.

      Returns:
      triggerQuantity
    • getDiscountedQuantity

      public Integer getDiscountedQuantity()

      Number of Custom Line Items that are discounted per application of this Discount. It must be less than or equal to the triggerQuantity.

      Returns:
      discountedQuantity
    • getMaxOccurrence

      @Nullable public Integer getMaxOccurrence()

      Maximum number of times this Discount can be applied. Do not set if the Discount should be applied an unlimited number of times.

      Returns:
      maxOccurrence
    • getSelectionMode

      public SelectionMode getSelectionMode()

      Discounts particular Line Items only according to the SelectionMode.

      Returns:
      selectionMode
    • build

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

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

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

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