Interface CustomLineItemImportDraft
- All Superinterfaces:
CustomizableDraft<CustomLineItemImportDraft>,Draft<CustomLineItemImportDraft>
Custom Line Items contain generic user-defined items that are not linked to Products.
Example to create an instance using the builder pattern
CustomLineItemImportDraft customLineItemImportDraft = CustomLineItemImportDraft.builder()
.name(nameBuilder -> nameBuilder)
.slug("{slug}")
.quantity(0.3)
.money(moneyBuilder -> moneyBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CustomLineItemImportDraftbuilder(CustomLineItemImportDraft template) create builder for CustomLineItemImportDraft instancecopyDeep()static CustomLineItemImportDraftdeepCopy(CustomLineItemImportDraft template) factory method to create a deep copy of CustomLineItemImportDraft@Valid CustomFieldsDraftCustom Fields of the CustomLineItem.getKey()User-defined unique identifier of the Custom Line Item.@NotNull @Valid MoneygetMoney()The cost of individual items in the Custom Line Item.@NotNull @Valid LocalizedStringgetName()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.@NotNull LongThe number of items in the Custom Line Item.@Valid ItemShippingDetailsDraftContainer for Custom Line Item-specific addresses.@NotNull StringgetSlug()User-defined identifier used in a deep-link URL for the Custom Line Item.getState()State of the Custom Line Items.Include a value to associate a Tax Category with the Custom Line Item.@Valid TaxRateThe tax rate used to calculate thetaxedPriceof the Order.static CustomLineItemImportDraftof()factory methodstatic CustomLineItemImportDraftof(CustomLineItemImportDraft template) factory method to create a shallow copy CustomLineItemImportDraftvoidsetCustom(CustomFieldsDraft custom) Custom Fields of the CustomLineItem.voidUser-defined unique identifier of the Custom Line Item.voidThe cost of individual items in the Custom Line Item.voidsetName(LocalizedString name) Name of the Custom Line Item.voidsetPriceMode(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.voidsetQuantity(Long quantity) The number of items in the Custom Line Item.voidsetShippingDetails(ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.voidUser-defined identifier used in a deep-link URL for the Custom Line Item.voidState of the Custom Line Items.voidState of the Custom Line Items.voidsetTaxCategory(TaxCategoryResourceIdentifier taxCategory) Include a value to associate a Tax Category with the Custom Line Item.voidsetTaxRate(TaxRate taxRate) The tax rate used to calculate thetaxedPriceof the Order.static com.fasterxml.jackson.core.type.TypeReference<CustomLineItemImportDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor 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
-
getSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern
[a-zA-Z0-9_-]{2,256}.- Returns:
- slug
-
getQuantity
The number of items in the Custom Line Item. Can be a negative value.
- Returns:
- quantity
-
getMoney
The cost of individual items in the Custom Line Item. The amount can be negative.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- money
-
getTaxRate
The tax rate used to calculate the
taxedPriceof the Order.- Returns:
- taxRate
-
getTaxCategory
Include a value to associate a Tax Category with the Custom Line Item.
- Returns:
- taxCategory
-
getPriceMode
CustomLineItemPriceMode 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
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Returns:
- shippingDetails
-
getState
State of the Custom Line Items.
- Returns:
- state
-
getCustom
Custom Fields of the CustomLineItem.
- Specified by:
getCustomin interfaceCustomizableDraft<CustomLineItemImportDraft>- Returns:
- custom
-
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
-
setSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern
[a-zA-Z0-9_-]{2,256}.- Parameters:
slug- value to be set
-
setQuantity
The number of items in the Custom Line Item. Can be a negative value.
- Parameters:
quantity- value to be set
-
setMoney
The cost of individual items in the Custom Line Item. The amount can be negative.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
money- value to be set
-
setTaxRate
The tax rate used to calculate the
taxedPriceof the Order.- Parameters:
taxRate- value to be set
-
setTaxCategory
Include a value to associate a Tax Category with the Custom Line Item.
- Parameters:
taxCategory- value to be set
-
setPriceMode
- 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
- If
-
setShippingDetails
Container for Custom Line Item-specific addresses.
- Parameters:
shippingDetails- value to be set
-
setState
State of the Custom Line Items.
- Parameters:
state- values to be set
-
setState
State of the Custom Line Items.
- Parameters:
state- values to be set
-
setCustom
Custom Fields of the CustomLineItem.
- Specified by:
setCustomin interfaceCustomizableDraft<CustomLineItemImportDraft>- Parameters:
custom- value to be set
-
of
factory method- Returns:
- instance of CustomLineItemImportDraft
-
of
factory method to create a shallow copy CustomLineItemImportDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CustomLineItemImportDraft copyDeep() -
deepCopy
factory method to create a deep copy of CustomLineItemImportDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CustomLineItemImportDraft- Returns:
- builder
-
builder
create builder for CustomLineItemImportDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCustomLineItemImportDraft
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
-