Class CustomLineItemDraftBuilder
- All Implemented Interfaces:
Builder<CustomLineItemDraft>
Example to create an instance using the builder pattern
CustomLineItemDraft customLineItemDraft = CustomLineItemDraft.builder()
.name(nameBuilder -> nameBuilder)
.money(moneyBuilder -> moneyBuilder)
.slug("{slug}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CustomLineItemDraft with checking for non-null required valuesbuilds CustomLineItemDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the Custom Line Item.Custom Fields for the Custom Line Item.externalTaxRate
(ExternalTaxRateDraft externalTaxRate) External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.Custom Fields for the Custom Line Item.External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.getKey()
User-defined unique identifier of the Custom Line Item.getMoney()
Money value of the Custom Line Item.getName()
Name of the Custom Line Item.IfStandard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. IfExternal
, Cart Discounts are not considered on the Custom Line Item.Number of Custom Line Items to add to the Cart.Container for Custom Line Item-specific addresses.getSlug()
User-defined identifier used in a deep-link URL for the Custom Line Item.Used to select a Tax Rate when a Cart has thePlatform
TaxMode.User-defined unique identifier of the Custom Line Item.Money value of the Custom Line Item.money
(Function<MoneyBuilder, MoneyBuilder> builder) Money value of the Custom Line Item.name
(LocalizedString name) Name of the Custom Line Item.Name of the Custom Line Item.static CustomLineItemDraftBuilder
of()
factory method for an instance of CustomLineItemDraftBuilderstatic CustomLineItemDraftBuilder
of
(CustomLineItemDraft template) create builder for CustomLineItemDraft instancepriceMode
(CustomLineItemPriceMode priceMode) IfStandard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. IfExternal
, Cart Discounts are not considered on the Custom Line Item.Number of Custom Line Items to add to the Cart.shippingDetails
(ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.Container for Custom Line Item-specific addresses.User-defined identifier used in a deep-link URL for the Custom Line Item.taxCategory
(TaxCategoryResourceIdentifier taxCategory) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.taxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.Custom Fields for the Custom Line Item.External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.withMoney
(Function<MoneyBuilder, Money> builder) Money value of the Custom Line Item.Name of the Custom Line Item.Container for Custom Line Item-specific addresses.withTaxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.
-
Constructor Details
-
CustomLineItemDraftBuilder
public CustomLineItemDraftBuilder()
-
-
Method Details
-
name
public CustomLineItemDraftBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the Custom Line Item.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
public CustomLineItemDraftBuilder withName(Function<LocalizedStringBuilder, LocalizedString> builder) Name of the Custom Line Item.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Custom Line Item.
- Parameters:
name
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Custom Line Item.
- Parameters:
key
- value to be set- Returns:
- Builder
-
quantity
Number of Custom Line Items to add to the Cart.
- Parameters:
quantity
- value to be set- Returns:
- Builder
-
money
Money value of the Custom Line Item. The value can be negative.
- Parameters:
builder
- function to build the money value- Returns:
- Builder
-
withMoney
Money value of the Custom Line Item. The value can be negative.
- Parameters:
builder
- function to build the money value- Returns:
- Builder
-
money
Money value of the Custom Line Item. The value can be negative.
- Parameters:
money
- value to be set- Returns:
- Builder
-
slug
User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern
[a-zA-Z0-9_-]{2,256}
.- Parameters:
slug
- value to be set- Returns:
- Builder
-
taxCategory
public CustomLineItemDraftBuilder taxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode. This field is required forPlatform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public CustomLineItemDraftBuilder withTaxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode. This field is required forPlatform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
Used to select a Tax Rate when a Cart has the
Platform
TaxMode. This field is required forPlatform
TaxMode.- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
externalTaxRate
public CustomLineItemDraftBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) External Tax Rate for the Custom Line Item if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CustomLineItemDraftBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) External Tax Rate for the Custom Line Item if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
External Tax Rate for the Custom Line Item if the Cart has the
External
TaxMode.- Parameters:
externalTaxRate
- value to be set- Returns:
- Builder
-
custom
public CustomLineItemDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Custom Line Item.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public CustomLineItemDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Custom Line Item.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Custom Line Item.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
shippingDetails
public CustomLineItemDraftBuilder shippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraftBuilder> builder) Container for Custom Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public CustomLineItemDraftBuilder withShippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraft> builder) Container for Custom Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
public CustomLineItemDraftBuilder shippingDetails(@Nullable ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set- Returns:
- Builder
-
priceMode
- If
Standard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. - If
External
, Cart Discounts are not considered on the Custom Line Item.
- Parameters:
priceMode
- value to be set- Returns:
- Builder
- If
-
getName
Name of the Custom Line Item.
- Returns:
- name
-
getKey
User-defined unique identifier of the Custom Line Item.
- Returns:
- key
-
getQuantity
Number of Custom Line Items to add to the Cart.
- Returns:
- quantity
-
getMoney
Money value of the Custom Line Item. The value can be negative.
- Returns:
- money
-
getSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern
[a-zA-Z0-9_-]{2,256}
.- Returns:
- slug
-
getTaxCategory
Used to select a Tax Rate when a Cart has the
Platform
TaxMode. This field is required forPlatform
TaxMode.- Returns:
- taxCategory
-
getExternalTaxRate
External Tax Rate for the Custom Line Item if the Cart has the
External
TaxMode.- Returns:
- externalTaxRate
-
getCustom
Custom Fields for the Custom Line Item.
- Returns:
- custom
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Returns:
- shippingDetails
-
getPriceMode
- If
Standard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. - If
External
, Cart Discounts are not considered on the Custom Line Item.
- Returns:
- priceMode
- If
-
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
-