Interface MultiBuyCustomLineItemsTarget

All Superinterfaces:
CartDiscountTarget
All Known Implementing Classes:
MultiBuyCustomLineItemsTargetImpl

public interface MultiBuyCustomLineItemsTarget extends CartDiscountTarget

This Discount target is similar to MultiBuyLineItems, but is applied on Custom Line Items instead of Line Items.


Example to create an instance using the builder pattern

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

    • MULTI_BUY_CUSTOM_LINE_ITEMS

      static final String MULTI_BUY_CUSTOM_LINE_ITEMS
      discriminator value for MultiBuyCustomLineItemsTarget
      See Also:
  • Method Details

    • getPredicate

      @NotNull @NotNull String getPredicate()

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

      Returns:
      predicate
    • getTriggerQuantity

      @NotNull @NotNull Integer getTriggerQuantity()

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

      Returns:
      triggerQuantity
    • getDiscountedQuantity

      @NotNull @NotNull 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

      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

      @NotNull @NotNull SelectionMode getSelectionMode()

      Discounts particular Line Items only according to the SelectionMode.

      Returns:
      selectionMode
    • setPredicate

      void setPredicate(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
    • setTriggerQuantity

      void setTriggerQuantity(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
    • setDiscountedQuantity

      void setDiscountedQuantity(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
    • setMaxOccurrence

      void setMaxOccurrence(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
    • setSelectionMode

      void setSelectionMode(SelectionMode selectionMode)

      Discounts particular Line Items only according to the SelectionMode.

      Parameters:
      selectionMode - value to be set
    • of

      factory method
      Returns:
      instance of MultiBuyCustomLineItemsTarget
    • of

      factory method to create a shallow copy MultiBuyCustomLineItemsTarget
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of MultiBuyCustomLineItemsTarget
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for MultiBuyCustomLineItemsTarget
      Returns:
      builder
    • builder

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

      default <T> T withMultiBuyCustomLineItemsTarget(Function<MultiBuyCustomLineItemsTarget,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<MultiBuyCustomLineItemsTarget> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference