Interface DiscountedLineItemPrice


public interface DiscountedLineItemPrice
DiscountedLineItemPrice
Example to create an instance using the builder pattern

     DiscountedLineItemPrice discountedLineItemPrice = DiscountedLineItemPrice.builder()
             .value(valueBuilder -> valueBuilder)
             .plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
             .build()
 
  • Method Details

    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()

      Money value of the discounted Line Item or Custom Line Item.

      When multiple discounts from includedDiscounts apply, they are applied sequentially based on the sortOrder of their associated Cart Discounts (discounts with higher sortOrder values are applied first). The Cart's priceRoundingMode field (RoundingMode) is applied after each discount calculation, so rounding occurs after each discount step rather than only once on the final cumulative amount.

      Returns:
      value
    • getIncludedDiscounts

      @NotNull @Valid @NotNull @Valid List<DiscountedLineItemPortion> getIncludedDiscounts()

      Discount applicable on the Line Item or Custom Line Item.

      Returns:
      includedDiscounts
    • setValue

      void setValue(TypedMoney value)

      Money value of the discounted Line Item or Custom Line Item.

      When multiple discounts from includedDiscounts apply, they are applied sequentially based on the sortOrder of their associated Cart Discounts (discounts with higher sortOrder values are applied first). The Cart's priceRoundingMode field (RoundingMode) is applied after each discount calculation, so rounding occurs after each discount step rather than only once on the final cumulative amount.

      Parameters:
      value - value to be set
    • setIncludedDiscounts

      void setIncludedDiscounts(DiscountedLineItemPortion... includedDiscounts)

      Discount applicable on the Line Item or Custom Line Item.

      Parameters:
      includedDiscounts - values to be set
    • setIncludedDiscounts

      void setIncludedDiscounts(List<DiscountedLineItemPortion> includedDiscounts)

      Discount applicable on the Line Item or Custom Line Item.

      Parameters:
      includedDiscounts - values to be set
    • of

      factory method
      Returns:
      instance of DiscountedLineItemPrice
    • of

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

    • deepCopy

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

      builder factory method for DiscountedLineItemPrice
      Returns:
      builder
    • builder

      create builder for DiscountedLineItemPrice instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDiscountedLineItemPrice

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