Class CustomLineItemDraftBuilder
java.lang.Object
com.commercetools.importapi.models.orders.CustomLineItemDraftBuilder
- All Implemented Interfaces:
Builder<CustomLineItemDraft>
CustomLineItemDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CustomLineItemDraft customLineItemDraft = CustomLineItemDraft.builder()
.name(nameBuilder -> nameBuilder)
.money(moneyBuilder -> moneyBuilder)
.totalPrice(totalPriceBuilder -> totalPriceBuilder)
.slug("{slug}")
.quantity(0.3)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraft> builder) add the value to the discountedPricePerQuantity using the builder functionaddState
(Function<ItemStateBuilder, ItemState> builder) add the value to the state using the builder functionbuild()
builds CustomLineItemDraft with checking for non-null required valuesbuilds CustomLineItemDraft without checking for non-null required valuesdiscountedPricePerQuantity
(DiscountedLineItemPriceDraft... discountedPricePerQuantity) set values to the discountedPricePerQuantitydiscountedPricePerQuantity
(List<DiscountedLineItemPriceDraft> discountedPricePerQuantity) set value to the discountedPricePerQuantityexternalTaxRate
(ExternalTaxRateDraft externalTaxRate) set the value to the externalTaxRateset the value to the externalTaxRate using the builder functionvalue of discountedPricePerQuantity}value of externalTaxRate}getMoney()
value of money}getName()
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.value of quantity}value of shippingDetails}getSlug()
value of slug}getState()
value of state}References a tax category by key.value of taxedPrice}value of taxRate}value of totalPrice}money
(TypedMoney money) set the value to the moneymoney
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) set the value to the money using the builder functionname
(LocalizedString name) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.static CustomLineItemDraftBuilder
of()
factory method for an instance of CustomLineItemDraftBuilderstatic CustomLineItemDraftBuilder
of
(CustomLineItemDraft template) create builder for CustomLineItemDraft instanceplusDiscountedPricePerQuantity
(DiscountedLineItemPriceDraft... discountedPricePerQuantity) add values to the discountedPricePerQuantityplusDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraftBuilder> builder) add the value to the discountedPricePerQuantity using the builder functionadd values to the stateplusState
(Function<ItemStateBuilder, ItemStateBuilder> builder) add the value to the state using the builder functionset the value to the quantitysetDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraft> builder) set the value to the discountedPricePerQuantity using the builder functionsetState
(Function<ItemStateBuilder, ItemState> builder) set the value to the state using the builder functionshippingDetails
(ItemShippingDetailsDraft shippingDetails) set the value to the shippingDetailsset the value to the shippingDetails using the builder functionset the value to the slugset values to the stateset value to the statetaxCategory
(TaxCategoryKeyReference taxCategory) References a tax category by key.References a tax category by key.taxedPrice
(CustomLineItemTaxedPrice taxedPrice) set the value to the taxedPriceset the value to the taxedPrice using the builder functionset the value to the taxRatetaxRate
(Function<TaxRateBuilder, TaxRateBuilder> builder) set the value to the taxRate using the builder functiontotalPrice
(TypedMoney totalPrice) set the value to the totalPricetotalPrice
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) set the value to the totalPrice using the builder functionwithDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraftBuilder> builder) set the value to the discountedPricePerQuantity using the builder functionset the value to the externalTaxRate using the builder functionA localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.set the value to the shippingDetails using the builder functionwithState
(Function<ItemStateBuilder, ItemStateBuilder> builder) set the value to the state using the builder functionReferences a tax category by key.set the value to the taxedPrice using the builder functionwithTaxRate
(Function<TaxRateBuilder, TaxRate> builder) set the value to the taxRate using the builder function
-
Constructor Details
-
CustomLineItemDraftBuilder
public CustomLineItemDraftBuilder()
-
-
Method Details
-
name
public CustomLineItemDraftBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
public CustomLineItemDraftBuilder withName(Function<LocalizedStringBuilder, LocalizedString> builder) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
name
- value to be set- Returns:
- Builder
-
money
set the value to the money- Parameters:
money
- value to be set- Returns:
- Builder
-
money
public CustomLineItemDraftBuilder money(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) set the value to the money using the builder function- Parameters:
builder
- function to build the money value- Returns:
- Builder
-
taxedPrice
public CustomLineItemDraftBuilder taxedPrice(Function<CustomLineItemTaxedPriceBuilder, CustomLineItemTaxedPriceBuilder> builder) set the value to the taxedPrice using the builder function- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
withTaxedPrice
public CustomLineItemDraftBuilder withTaxedPrice(Function<CustomLineItemTaxedPriceBuilder, CustomLineItemTaxedPrice> builder) 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- Parameters:
totalPrice
- value to be set- Returns:
- Builder
-
totalPrice
public CustomLineItemDraftBuilder totalPrice(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) set the value to the totalPrice using the builder function- Parameters:
builder
- function to build the totalPrice value- Returns:
- Builder
-
slug
set the value to the slug- Parameters:
slug
- value to be set- Returns:
- Builder
-
quantity
set the value to the quantity- Parameters:
quantity
- value to be set- Returns:
- Builder
-
state
set values to the state- Parameters:
state
- value to be set- Returns:
- Builder
-
state
set value to the state- Parameters:
state
- value to be set- Returns:
- Builder
-
plusState
add values to the state- Parameters:
state
- value to be set- Returns:
- Builder
-
plusState
add the value to the state using the builder function- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
set the value to the state using the builder function- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
addState
add the value to the state using the builder function- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
setState
set the value to the state using the builder function- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
taxCategory
public CustomLineItemDraftBuilder taxCategory(Function<TaxCategoryKeyReferenceBuilder, TaxCategoryKeyReferenceBuilder> builder) References a tax category by key.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public CustomLineItemDraftBuilder withTaxCategory(Function<TaxCategoryKeyReferenceBuilder, TaxCategoryKeyReference> builder) References a tax category by key.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
References a tax category by key.
- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
taxRate
set the value to the taxRate using the builder function- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
-
withTaxRate
set the value to the taxRate using the builder function- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
-
taxRate
set the value to the taxRate- Parameters:
taxRate
- value to be set- Returns:
- Builder
-
externalTaxRate
public CustomLineItemDraftBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) set the value to the externalTaxRate using the builder function- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CustomLineItemDraftBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) set the value to the externalTaxRate using the builder function- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
set the value to the externalTaxRate- Parameters:
externalTaxRate
- value to be set- Returns:
- Builder
-
discountedPricePerQuantity
public CustomLineItemDraftBuilder discountedPricePerQuantity(@Nullable DiscountedLineItemPriceDraft... discountedPricePerQuantity) set values to the discountedPricePerQuantity- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
discountedPricePerQuantity
public CustomLineItemDraftBuilder discountedPricePerQuantity(@Nullable List<DiscountedLineItemPriceDraft> discountedPricePerQuantity) set value to the discountedPricePerQuantity- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
plusDiscountedPricePerQuantity
public CustomLineItemDraftBuilder plusDiscountedPricePerQuantity(@Nullable DiscountedLineItemPriceDraft... discountedPricePerQuantity) add values to the discountedPricePerQuantity- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
plusDiscountedPricePerQuantity
public CustomLineItemDraftBuilder plusDiscountedPricePerQuantity(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraftBuilder> builder) add the value to the discountedPricePerQuantity using the builder function- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
withDiscountedPricePerQuantity
public CustomLineItemDraftBuilder withDiscountedPricePerQuantity(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraftBuilder> builder) set the value to the discountedPricePerQuantity using the builder function- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
addDiscountedPricePerQuantity
public CustomLineItemDraftBuilder addDiscountedPricePerQuantity(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraft> builder) add the value to the discountedPricePerQuantity using the builder function- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
setDiscountedPricePerQuantity
public CustomLineItemDraftBuilder setDiscountedPricePerQuantity(Function<DiscountedLineItemPriceDraftBuilder, DiscountedLineItemPriceDraft> builder) set the value to the discountedPricePerQuantity using the builder function- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
shippingDetails
public CustomLineItemDraftBuilder shippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraftBuilder> builder) set the value to the shippingDetails using the builder function- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public CustomLineItemDraftBuilder withShippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraft> builder) set the value to the shippingDetails using the builder function- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
public CustomLineItemDraftBuilder shippingDetails(@Nullable ItemShippingDetailsDraft shippingDetails) set the value to the shippingDetails- Parameters:
shippingDetails
- value to be set- Returns:
- Builder
-
getName
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Returns:
- name
-
getMoney
value of money}- Returns:
- money
-
getTaxedPrice
value of taxedPrice}- Returns:
- taxedPrice
-
getTotalPrice
value of totalPrice}- Returns:
- totalPrice
-
getSlug
value of slug}- Returns:
- slug
-
getQuantity
value of quantity}- Returns:
- quantity
-
getState
value of state}- Returns:
- state
-
getTaxCategory
References a tax category by key.
- Returns:
- taxCategory
-
getTaxRate
value of taxRate}- Returns:
- taxRate
-
getExternalTaxRate
value of externalTaxRate}- Returns:
- externalTaxRate
-
getDiscountedPricePerQuantity
value of discountedPricePerQuantity}- Returns:
- discountedPricePerQuantity
-
getShippingDetails
value of shippingDetails}- Returns:
- shippingDetails
-
build
builds CustomLineItemDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<CustomLineItemDraft>
- Returns:
- CustomLineItemDraft
-
buildUnchecked
builds CustomLineItemDraft without checking for non-null required values- Returns:
- CustomLineItemDraft
-
of
factory method for an instance of CustomLineItemDraftBuilder- Returns:
- builder
-
of
create builder for CustomLineItemDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-