Interface CartDiscountValueFixed

All Superinterfaces:
CartDiscountValue, CartDiscountValueFixedMixin, CartDiscountValueMixin, GenericCartDiscountValueMixin<CartDiscountValueFixedDraft>

public interface CartDiscountValueFixed extends CartDiscountValue, CartDiscountValueFixedMixin

Sets the DiscountedLineItemPrice of the CartDiscountLineItemsTarget or CartDiscountCustomLineItemsTarget to the value specified in the money field, if it is lower than the current Line Item price for the same currency. If the Line Item price is already discounted to a price equal to or lower than the respective price in the money field, this Discount is not applied. If the quantity of the Line Item eligible for the Discount is greater than 1, the fixed price discount is only applied to the Line Item portion for which the money value is lesser than their current price.


Example to create an instance using the builder pattern

     CartDiscountValueFixed cartDiscountValueFixed = CartDiscountValueFixed.builder()
             .plusMoney(moneyBuilder -> moneyBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getMoney

      @NotNull @Valid @NotNull @Valid List<TypedMoney> getMoney()

      Money values in cent precision or high precision of different currencies.

      Specified by:
      getMoney in interface CartDiscountValueFixedMixin
      Returns:
      money
    • getApplicationMode

      DiscountApplicationMode getApplicationMode()

      Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

      For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

      Returns:
      applicationMode
    • setMoney

      void setMoney(TypedMoney... money)

      Money values in cent precision or high precision of different currencies.

      Parameters:
      money - values to be set
    • setMoney

      void setMoney(List<TypedMoney> money)

      Money values in cent precision or high precision of different currencies.

      Parameters:
      money - values to be set
    • setApplicationMode

      void setApplicationMode(DiscountApplicationMode applicationMode)

      Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

      For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

      Parameters:
      applicationMode - value to be set
    • of

      factory method
      Returns:
      instance of CartDiscountValueFixed
    • of

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

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

      builder factory method for CartDiscountValueFixed
      Returns:
      builder
    • builder

      create builder for CartDiscountValueFixed instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartDiscountValueFixed

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