Interface CustomLineItemDraft
- All Superinterfaces:
CustomizableDraft<CustomLineItemDraft>
,Draft<CustomLineItemDraft>
Example to create an instance using the builder pattern
CustomLineItemDraft customLineItemDraft = CustomLineItemDraft.builder()
.name(nameBuilder -> nameBuilder)
.money(moneyBuilder -> moneyBuilder)
.slug("{slug}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomLineItemDraftBuilder
builder()
builder factory method for CustomLineItemDraftstatic CustomLineItemDraftBuilder
builder
(CustomLineItemDraft template) create builder for CustomLineItemDraft instancestatic CustomLineItemDraft
deepCopy
(CustomLineItemDraft template) factory method to create a deep copy of CustomLineItemDraft@Valid CustomFieldsDraft
Custom Fields for the Custom Line Item.@Valid ExternalTaxRateDraft
External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.getKey()
User-defined unique identifier of the Custom Line Item.@NotNull @Valid Money
getMoney()
Money value of the Custom Line Item.@NotNull @Valid LocalizedString
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.@Valid ItemShippingDetailsDraft
Container for Custom Line Item-specific addresses.@NotNull String
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.static CustomLineItemDraft
of()
factory methodstatic CustomLineItemDraft
of
(CustomLineItemDraft template) factory method to create a shallow copy CustomLineItemDraftvoid
setCustom
(CustomFieldsDraft custom) Custom Fields for the Custom Line Item.void
setExternalTaxRate
(ExternalTaxRateDraft externalTaxRate) External Tax Rate for the Custom Line Item if the Cart has theExternal
TaxMode.void
User-defined unique identifier of the Custom Line Item.void
Money value of the Custom Line Item.void
setName
(LocalizedString name) Name of the Custom Line Item.void
setPriceMode
(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.void
setQuantity
(Long quantity) Number of Custom Line Items to add to the Cart.void
setShippingDetails
(ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.void
User-defined identifier used in a deep-link URL for the Custom Line Item.void
setTaxCategory
(TaxCategoryResourceIdentifier taxCategory) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.static com.fasterxml.jackson.core.type.TypeReference<CustomLineItemDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCustomLineItemDraft
(Function<CustomLineItemDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getName
Name of the Custom Line Item.
- Returns:
- name
-
getKey
String getKey()User-defined unique identifier of the Custom Line Item.
- Returns:
- key
-
getQuantity
Long 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.
- Specified by:
getCustom
in interfaceCustomizableDraft<CustomLineItemDraft>
- Returns:
- custom
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Returns:
- shippingDetails
-
getPriceMode
CustomLineItemPriceMode 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
-
setName
Name of the Custom Line Item.
- Parameters:
name
- value to be set
-
setKey
User-defined unique identifier of the Custom Line Item.
- Parameters:
key
- value to be set
-
setQuantity
Number of Custom Line Items to add to the Cart.
- Parameters:
quantity
- value to be set
-
setMoney
Money value of the Custom Line Item. The value can be negative.
- Parameters:
money
- value to be set
-
setSlug
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
-
setTaxCategory
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
-
setExternalTaxRate
External Tax Rate for the Custom Line Item if the Cart has the
External
TaxMode.- Parameters:
externalTaxRate
- value to be set
-
setCustom
Custom Fields for the Custom Line Item.
- Specified by:
setCustom
in interfaceCustomizableDraft<CustomLineItemDraft>
- Parameters:
custom
- value to be set
-
setShippingDetails
Container for Custom Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set
-
setPriceMode
- 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
- If
-
of
factory method- Returns:
- instance of CustomLineItemDraft
-
of
factory method to create a shallow copy CustomLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CustomLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CustomLineItemDraft- Returns:
- builder
-
builder
create builder for CustomLineItemDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCustomLineItemDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-