Class CartAddCustomLineItemActionImpl
- All Implemented Interfaces:
CartAddCustomLineItemAction
,CartUpdateAction
,CustomizableDraft<CartAddCustomLineItemAction>
,ResourceUpdateAction<CartUpdateAction>
,io.vrap.rmf.base.client.ModelBase
If the Cart already contains a CustomLineItem with the same slug
, name
, money
, taxCategory
, state
, and Custom Fields, then only the quantity of the existing Custom Line Item is increased. If CustomLineItem shippingDetails
are set, they are merged with the targets
that already exist on the ItemShippingDetails of the Custom Line Item. In case of overlapping address keys the ItemShippingTarget quantity
is summed up.
If the Cart already contains a Custom Line Item with the same slug that is otherwise not identical, an InvalidOperation error is returned.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Field Summary
Fields inherited from interface com.commercetools.api.models.cart.CartAddCustomLineItemAction
ADD_CUSTOM_LINE_ITEM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.int
hashCode()
void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Custom Line Item.void
setExternalTaxRate
(ExternalTaxRateDraft externalTaxRate) An external Tax Rate can be set if the Cart hasExternal
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.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.cart.CartAddCustomLineItemAction
withCartAddCustomLineItemAction
Methods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
withCartUpdateAction
Methods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Constructor Details
-
CartAddCustomLineItemActionImpl
public CartAddCustomLineItemActionImpl()create empty instance
-
-
Method Details
-
getAction
- Specified by:
getAction
in interfaceCartUpdateAction
- Specified by:
getAction
in interfaceResourceUpdateAction<CartUpdateAction>
- Returns:
- action
-
getMoney
Money value of the Custom Line Item. The value can be negative.
- Specified by:
getMoney
in interfaceCartAddCustomLineItemAction
- Returns:
- money
-
getName
Name of the Custom Line Item.
- Specified by:
getName
in interfaceCartAddCustomLineItemAction
- Returns:
- name
-
getKey
User-defined unique identifier of the Custom Line Item.
- Specified by:
getKey
in interfaceCartAddCustomLineItemAction
- Returns:
- key
-
getQuantity
Number of Custom Line Items to add to the Cart.
- Specified by:
getQuantity
in interfaceCartAddCustomLineItemAction
- 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}
.- Specified by:
getSlug
in interfaceCartAddCustomLineItemAction
- 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.- Specified by:
getTaxCategory
in interfaceCartAddCustomLineItemAction
- Returns:
- taxCategory
-
getExternalTaxRate
An external Tax Rate can be set if the Cart has
External
TaxMode.- Specified by:
getExternalTaxRate
in interfaceCartAddCustomLineItemAction
- Returns:
- externalTaxRate
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Specified by:
getShippingDetails
in interfaceCartAddCustomLineItemAction
- Returns:
- shippingDetails
-
getCustom
Custom Fields for the Custom Line Item.
- Specified by:
getCustom
in interfaceCartAddCustomLineItemAction
- Specified by:
getCustom
in interfaceCustomizableDraft<CartAddCustomLineItemAction>
- 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.
- Specified by:
getPriceMode
in interfaceCartAddCustomLineItemAction
- Returns:
- priceMode
- If
-
setMoney
Description copied from interface:CartAddCustomLineItemAction
Money value of the Custom Line Item. The value can be negative.
- Specified by:
setMoney
in interfaceCartAddCustomLineItemAction
- Parameters:
money
- value to be set
-
setName
Description copied from interface:CartAddCustomLineItemAction
Name of the Custom Line Item.
- Specified by:
setName
in interfaceCartAddCustomLineItemAction
- Parameters:
name
- value to be set
-
setKey
Description copied from interface:CartAddCustomLineItemAction
User-defined unique identifier of the Custom Line Item.
- Specified by:
setKey
in interfaceCartAddCustomLineItemAction
- Parameters:
key
- value to be set
-
setQuantity
Description copied from interface:CartAddCustomLineItemAction
Number of Custom Line Items to add to the Cart.
- Specified by:
setQuantity
in interfaceCartAddCustomLineItemAction
- Parameters:
quantity
- value to be set
-
setSlug
Description copied from interface:CartAddCustomLineItemAction
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}
.- Specified by:
setSlug
in interfaceCartAddCustomLineItemAction
- Parameters:
slug
- value to be set
-
setTaxCategory
Description copied from interface:CartAddCustomLineItemAction
Used to select a Tax Rate when a Cart has the
Platform
TaxMode.If TaxMode is
Platform
, this field must not be empty.- Specified by:
setTaxCategory
in interfaceCartAddCustomLineItemAction
- Parameters:
taxCategory
- value to be set
-
setExternalTaxRate
Description copied from interface:CartAddCustomLineItemAction
An external Tax Rate can be set if the Cart has
External
TaxMode.- Specified by:
setExternalTaxRate
in interfaceCartAddCustomLineItemAction
- Parameters:
externalTaxRate
- value to be set
-
setShippingDetails
Description copied from interface:CartAddCustomLineItemAction
Container for Custom Line Item-specific addresses.
- Specified by:
setShippingDetails
in interfaceCartAddCustomLineItemAction
- Parameters:
shippingDetails
- value to be set
-
setCustom
Description copied from interface:CartAddCustomLineItemAction
Custom Fields for the Custom Line Item.
- Specified by:
setCustom
in interfaceCartAddCustomLineItemAction
- Specified by:
setCustom
in interfaceCustomizableDraft<CartAddCustomLineItemAction>
- Parameters:
custom
- value to be set
-
setPriceMode
Description copied from interface:CartAddCustomLineItemAction
- 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.
- Specified by:
setPriceMode
in interfaceCartAddCustomLineItemAction
- Parameters:
priceMode
- value to be set
- If
-
equals
-
hashCode
-