Class DiscountedLineItemPriceForQuantityBuilder

java.lang.Object
com.commercetools.api.models.cart.DiscountedLineItemPriceForQuantityBuilder
All Implemented Interfaces:
Builder<DiscountedLineItemPriceForQuantity>

public class DiscountedLineItemPriceForQuantityBuilder extends Object implements Builder<DiscountedLineItemPriceForQuantity>
DiscountedLineItemPriceForQuantityBuilder
Example to create an instance using the builder pattern

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

    • DiscountedLineItemPriceForQuantityBuilder

      public DiscountedLineItemPriceForQuantityBuilder()
  • Method Details

    • quantity

      public DiscountedLineItemPriceForQuantityBuilder quantity(Long quantity)

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

      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • 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:
      builder - function to build the discountedPrice value
      Returns:
      Builder
    • withDiscountedPrice

      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:
      builder - function to build the discountedPrice value
      Returns:
      Builder
    • discountedPrice

      public DiscountedLineItemPriceForQuantityBuilder discountedPrice(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
      Returns:
      Builder
    • getQuantity

      public Long getQuantity()

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

      Returns:
      quantity
    • getDiscountedPrice

      public 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
    • build

      builds DiscountedLineItemPriceForQuantity with checking for non-null required values
      Specified by:
      build in interface Builder<DiscountedLineItemPriceForQuantity>
      Returns:
      DiscountedLineItemPriceForQuantity
    • buildUnchecked

      public DiscountedLineItemPriceForQuantity buildUnchecked()
      builds DiscountedLineItemPriceForQuantity without checking for non-null required values
      Returns:
      DiscountedLineItemPriceForQuantity
    • of

      factory method for an instance of DiscountedLineItemPriceForQuantityBuilder
      Returns:
      builder
    • of

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