Class CartAddCustomLineItemActionBuilder
- All Implemented Interfaces:
Builder<CartAddCustomLineItemAction>
Example to create an instance using the builder pattern
CartAddCustomLineItemAction cartAddCustomLineItemAction = CartAddCustomLineItemAction.builder()
.money(moneyBuilder -> moneyBuilder)
.name(nameBuilder -> nameBuilder)
.slug("{slug}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CartAddCustomLineItemAction with checking for non-null required valuesbuilds CartAddCustomLineItemAction 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) An external Tax Rate can be set if the Cart hasExternal
TaxMode.An external Tax Rate can be set if the Cart hasExternal
TaxMode.Custom Fields for the Custom Line Item.An external Tax Rate can be set if the Cart hasExternal
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 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.of()
factory method for an instance of CartAddCustomLineItemActionBuilderof
(CartAddCustomLineItemAction template) create builder for CartAddCustomLineItemAction instancepriceMode
(CustomLineItemPriceMode priceMode) IfStandard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget 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.An external Tax Rate can be set if the Cart hasExternal
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
-
CartAddCustomLineItemActionBuilder
public CartAddCustomLineItemActionBuilder()
-
-
Method Details
-
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
-
name
public CartAddCustomLineItemActionBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the Custom Line Item.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
public CartAddCustomLineItemActionBuilder 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
-
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 CartAddCustomLineItemActionBuilder taxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode.If TaxMode is
Platform
, this field must not be empty.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public CartAddCustomLineItemActionBuilder withTaxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode.If TaxMode is
Platform
, this field must not be empty.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
public CartAddCustomLineItemActionBuilder taxCategory(@Nullable TaxCategoryResourceIdentifier taxCategory) Used to select a Tax Rate when a Cart has the
Platform
TaxMode.If TaxMode is
Platform
, this field must not be empty.- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
externalTaxRate
public CartAddCustomLineItemActionBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) An external Tax Rate can be set if the Cart has
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CartAddCustomLineItemActionBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) An external Tax Rate can be set if the Cart has
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
public CartAddCustomLineItemActionBuilder externalTaxRate(@Nullable ExternalTaxRateDraft externalTaxRate) An external Tax Rate can be set if the Cart has
External
TaxMode.- Parameters:
externalTaxRate
- value to be set- Returns:
- Builder
-
shippingDetails
public CartAddCustomLineItemActionBuilder shippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraftBuilder> builder) Container for Custom Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public CartAddCustomLineItemActionBuilder withShippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraft> builder) Container for Custom Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
public CartAddCustomLineItemActionBuilder shippingDetails(@Nullable ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set- Returns:
- Builder
-
custom
public CartAddCustomLineItemActionBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Custom Line Item.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public CartAddCustomLineItemActionBuilder 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
-
priceMode
- If
Standard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget 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
-
getMoney
Money value of the Custom Line Item. The value can be negative.
- Returns:
- money
-
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
-
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.If TaxMode is
Platform
, this field must not be empty.- Returns:
- taxCategory
-
getExternalTaxRate
An external Tax Rate can be set if the Cart has
External
TaxMode.- Returns:
- externalTaxRate
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Returns:
- shippingDetails
-
getCustom
Custom Fields for the Custom Line Item.
- Returns:
- custom
-
getPriceMode
- If
Standard
, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item. - If
External
, Cart Discounts are not considered on the Custom Line Item.
- Returns:
- priceMode
- If
-
build
builds CartAddCustomLineItemAction with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartAddCustomLineItemAction>
- Returns:
- CartAddCustomLineItemAction
-
buildUnchecked
builds CartAddCustomLineItemAction without checking for non-null required values- Returns:
- CartAddCustomLineItemAction
-
of
factory method for an instance of CartAddCustomLineItemActionBuilder- Returns:
- builder
-
of
create builder for CartAddCustomLineItemAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-