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
Example to create an instance using the builder pattern
DiscountedLineItemPriceForQuantity discountedLineItemPriceForQuantity = DiscountedLineItemPriceForQuantity.builder()
.quantity(0.3)
.discountedPrice(discountedPriceBuilder -> discountedPriceBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountedLineItemPriceForQuantity with checking for non-null required valuesbuilds DiscountedLineItemPriceForQuantity without checking for non-null required valuesdiscountedPrice
(DiscountedLineItemPrice discountedPrice) Discounted price of the Line Item or Custom Line Item.Discounted price of the Line Item or Custom Line Item.Discounted price of the Line Item or Custom Line Item.Number of Line Items or Custom Line Items in the Cart.of()
factory method for an instance of DiscountedLineItemPriceForQuantityBuilderof
(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instanceNumber of Line Items or Custom Line Items in the Cart.Discounted price of the Line Item or Custom Line Item.
-
Constructor Details
-
DiscountedLineItemPriceForQuantityBuilder
public DiscountedLineItemPriceForQuantityBuilder()
-
-
Method Details
-
quantity
Number of Line Items or Custom Line Items in the Cart.
- Parameters:
quantity
- value to be set- Returns:
- Builder
-
discountedPrice
public DiscountedLineItemPriceForQuantityBuilder discountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPriceBuilder> builder) Discounted price of the Line Item or Custom Line Item.
- Parameters:
builder
- function to build the discountedPrice value- Returns:
- Builder
-
withDiscountedPrice
public DiscountedLineItemPriceForQuantityBuilder withDiscountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPrice> builder) Discounted price of the Line Item or Custom Line Item.
- 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.
- Parameters:
discountedPrice
- value to be set- Returns:
- Builder
-
getQuantity
Number of Line Items or Custom Line Items in the Cart.
- Returns:
- quantity
-
getDiscountedPrice
Discounted price of the Line Item or Custom Line Item.
- Returns:
- discountedPrice
-
build
builds DiscountedLineItemPriceForQuantity with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedLineItemPriceForQuantity>
- Returns:
- DiscountedLineItemPriceForQuantity
-
buildUnchecked
builds DiscountedLineItemPriceForQuantity without checking for non-null required values- Returns:
- DiscountedLineItemPriceForQuantity
-
of
factory method for an instance of DiscountedLineItemPriceForQuantityBuilder- Returns:
- builder
-
of
public static DiscountedLineItemPriceForQuantityBuilder of(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-