Class CustomLineItemBuilder
java.lang.Object
com.commercetools.history.models.common.CustomLineItemBuilder
- All Implemented Interfaces:
Builder<CustomLineItem>
CustomLineItemBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CustomLineItem customLineItem = CustomLineItem.builder()
.id("{id}")
.name(nameBuilder -> nameBuilder)
.money(moneyBuilder -> moneyBuilder)
.taxedPrice(taxedPriceBuilder -> taxedPriceBuilder)
.totalPrice(totalPriceBuilder -> totalPriceBuilder)
.slug("{slug}")
.quantity(1)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CustomLineItem with checking for non-null required valuesbuilds CustomLineItem without checking for non-null required valuesgetId()
The unique ID of this CustomLineItem.getMoney()
value of money}getName()
value of name}The amount of a CustomLineItem in the cart.getSlug()
A unique String in the cart to identify this CustomLineItem.value of taxedPrice}value of totalPrice}The unique ID of this CustomLineItem.set the value to the moneymoney
(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the money using the builder functionname
(LocalizedString name) set the value to the nameset the value to the name using the builder functionstatic CustomLineItemBuilder
of()
factory method for an instance of CustomLineItemBuilderstatic CustomLineItemBuilder
of
(CustomLineItem template) create builder for CustomLineItem instanceThe amount of a CustomLineItem in the cart.A unique String in the cart to identify this CustomLineItem.taxedPrice
(TaxedItemPrice taxedPrice) set the value to the taxedPriceset the value to the taxedPrice using the builder functiontotalPrice
(Money totalPrice) set the value to the totalPricetotalPrice
(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the totalPrice using the builder functionwithMoney
(Function<MoneyBuilder, Money> builder) set the value to the money using the builder functionset the value to the name using the builder functionset the value to the taxedPrice using the builder functionwithTotalPrice
(Function<MoneyBuilder, Money> builder) set the value to the totalPrice using the builder function
-
Constructor Details
-
CustomLineItemBuilder
public CustomLineItemBuilder()
-
-
Method Details
-
id
The unique ID of this CustomLineItem.
- Parameters:
id
- value to be set- Returns:
- Builder
-
name
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
set the value to the name- Parameters:
name
- value to be set- Returns:
- Builder
-
money
set the value to the money using the builder function- Parameters:
builder
- function to build the money value- Returns:
- Builder
-
withMoney
set the value to the money using the builder function- Parameters:
builder
- function to build the money value- Returns:
- Builder
-
money
set the value to the money- Parameters:
money
- value to be set- Returns:
- Builder
-
taxedPrice
public CustomLineItemBuilder taxedPrice(Function<TaxedItemPriceBuilder, TaxedItemPriceBuilder> builder) set the value to the taxedPrice using the builder function- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
withTaxedPrice
set the value to the taxedPrice using the builder function- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
taxedPrice
set the value to the taxedPrice- Parameters:
taxedPrice
- value to be set- Returns:
- Builder
-
totalPrice
set the value to the totalPrice using the builder function- Parameters:
builder
- function to build the totalPrice value- Returns:
- Builder
-
withTotalPrice
set the value to the totalPrice using the builder function- Parameters:
builder
- function to build the totalPrice value- Returns:
- Builder
-
totalPrice
set the value to the totalPrice- Parameters:
totalPrice
- value to be set- Returns:
- Builder
-
slug
A unique String in the cart to identify this CustomLineItem.
- Parameters:
slug
- value to be set- Returns:
- Builder
-
quantity
The amount of a CustomLineItem in the cart. Must be a positive integer.
- Parameters:
quantity
- value to be set- Returns:
- Builder
-
getId
The unique ID of this CustomLineItem.
- Returns:
- id
-
getName
value of name}- Returns:
- name
-
getMoney
value of money}- Returns:
- money
-
getTaxedPrice
value of taxedPrice}- Returns:
- taxedPrice
-
getTotalPrice
value of totalPrice}- Returns:
- totalPrice
-
getSlug
A unique String in the cart to identify this CustomLineItem.
- Returns:
- slug
-
getQuantity
The amount of a CustomLineItem in the cart. Must be a positive integer.
- Returns:
- quantity
-
build
builds CustomLineItem with checking for non-null required values- Specified by:
build
in interfaceBuilder<CustomLineItem>
- Returns:
- CustomLineItem
-
buildUnchecked
builds CustomLineItem without checking for non-null required values- Returns:
- CustomLineItem
-
of
factory method for an instance of CustomLineItemBuilder- Returns:
- builder
-
of
create builder for CustomLineItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-