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 instancestatic CustomLineItemImportDraft
deepCopy
(CustomLineItemImportDraft template) factory method to create a deep copy of CustomLineItemImportDraft@Valid CustomFieldsDraft
Custom Fields of the CustomLineItem.getKey()
User-defined unique identifier of the Custom Line Item.@NotNull @Valid Money
getMoney()
The cost of individual items in the Custom Line Item.@NotNull @Valid LocalizedString
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.@NotNull Long
The number of items in the Custom Line Item.@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.getState()
State of the Custom Line Items.Include a value to associate a Tax Category with the Custom Line Item.@Valid TaxRate
The tax rate used to calculate thetaxedPrice
of the Order.static CustomLineItemImportDraft
of()
factory methodstatic CustomLineItemImportDraft
of
(CustomLineItemImportDraft template) factory method to create a shallow copy CustomLineItemImportDraftvoid
setCustom
(CustomFieldsDraft custom) Custom Fields of the CustomLineItem.void
User-defined unique identifier of the Custom Line Item.void
The cost of individual items in 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, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. IfExternal
, Cart Discounts are not considered on the Custom Line Item.void
setQuantity
(Long quantity) The number of items in the Custom Line Item.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
State of the Custom Line Items.void
State of the Custom Line Items.void
setTaxCategory
(TaxCategoryResourceIdentifier taxCategory) Include a value to associate a Tax Category with the Custom Line Item.void
setTaxRate
(TaxRate taxRate) The tax rate used to calculate thetaxedPrice
of the Order.static com.fasterxml.jackson.core.type.TypeReference<CustomLineItemImportDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
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
-
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.
- Returns:
- money
-
getTaxRate
The tax rate used to calculate the
taxedPrice
of 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:
getCustom
in 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.
- Parameters:
money
- value to be set
-
setTaxRate
The tax rate used to calculate the
taxedPrice
of 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:
setCustom
in 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
-
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
-