Interface DiscountsConfiguration


public interface DiscountsConfiguration

Holds the configuration for behavior of Product and Cart Discounts.


Example to create an instance using the builder pattern

     DiscountsConfiguration discountsConfiguration = DiscountsConfiguration.builder()
             .discountCombinationMode(DiscountCombinationMode.BEST_DEAL)
             .build()
 
  • Method Details

    • getDiscountCombinationMode

      @NotNull @NotNull DiscountCombinationMode getDiscountCombinationMode()

      Indicates how Product Discounts and Cart Discounts should be combined. Default value is Stacking.

      Returns:
      discountCombinationMode
    • setDiscountCombinationMode

      void setDiscountCombinationMode(DiscountCombinationMode discountCombinationMode)

      Indicates how Product Discounts and Cart Discounts should be combined. Default value is Stacking.

      Parameters:
      discountCombinationMode - value to be set
    • of

      factory method
      Returns:
      instance of DiscountsConfiguration
    • of

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

    • deepCopy

      @Nullable static DiscountsConfiguration deepCopy(@Nullable DiscountsConfiguration template)
      factory method to create a deep copy of DiscountsConfiguration
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for DiscountsConfiguration
      Returns:
      builder
    • builder

      create builder for DiscountsConfiguration instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDiscountsConfiguration

      default <T> T withDiscountsConfiguration(Function<DiscountsConfiguration,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<DiscountsConfiguration> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference