Interface DiscountedLineItemPriceForQuantity


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

     DiscountedLineItemPriceForQuantity discountedLineItemPriceForQuantity = DiscountedLineItemPriceForQuantity.builder()
             .quantity(0.3)
             .discountedPrice(discountedPriceBuilder -> discountedPriceBuilder)
             .build()
 
  • Method Details

    • getQuantity

      @NotNull @NotNull Long getQuantity()

      Number of Line Items or Custom Line Items in the Cart.

      Returns:
      quantity
    • getDiscountedPrice

      @NotNull @Valid @NotNull @Valid DiscountedLineItemPrice getDiscountedPrice()

      Discounted price of the Line Item or Custom Line Item.

      When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their sortOrder values (higher values are applied first). The price rounding mode specified by the Cart's priceRoundingMode field is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.

      Returns:
      discountedPrice
    • setQuantity

      void setQuantity(Long quantity)

      Number of Line Items or Custom Line Items in the Cart.

      Parameters:
      quantity - value to be set
    • setDiscountedPrice

      void setDiscountedPrice(DiscountedLineItemPrice discountedPrice)

      Discounted price of the Line Item or Custom Line Item.

      When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their sortOrder values (higher values are applied first). The price rounding mode specified by the Cart's priceRoundingMode field is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.

      Parameters:
      discountedPrice - value to be set
    • of

      factory method
      Returns:
      instance of DiscountedLineItemPriceForQuantity
    • of

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

    • deepCopy

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

      builder factory method for DiscountedLineItemPriceForQuantity
      Returns:
      builder
    • builder

      create builder for DiscountedLineItemPriceForQuantity instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDiscountedLineItemPriceForQuantity

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