Class MyCartAddLineItemActionImpl
- All Implemented Interfaces:
CustomizableDraft<MyCartAddLineItemAction>
,MyCartAddLineItemAction
,MyCartUpdateAction
,ResourceUpdateAction<MyCartUpdateAction>
,io.vrap.rmf.base.client.ModelBase
If the Cart contains a LineItem for a Product Variant with the same LineItemMode, Custom Fields, supply and distribution channel, then only the quantity of the existing Line Item is increased. If LineItem shippingDetails
is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. A new Line Item is added when the externalPrice
or externalTotalPrice
is set in this update action. The LineItem price is set as described in LineItem Price selection.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
If the Line Items do not have a Price according to the Product priceMode
value for a selected currency and/or country, Customer Group, or Channel, a MatchingPriceNotFound 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.me.MyCartAddLineItemAction
ADD_LINE_ITEM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Date and time (UTC) the Line Item was added to the Cart.Custom Fields for the Line Item.Used to select a Product Price.getKey()
User-defined unique identifier of the LineItem.id
of the Product.Number of Line Items to add to the Cart.Container for Line Item-specific addresses.getSku()
sku
of the ProductVariant.Used to identify Inventory entries that must be reserved.id
of the ProductVariant in the Product.int
hashCode()
void
setAddedAt
(ZonedDateTime addedAt) Date and time (UTC) the Line Item was added to the Cart.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Line Item.void
setDistributionChannel
(ChannelResourceIdentifier distributionChannel) Used to select a Product Price.void
User-defined unique identifier of the LineItem.void
setProductId
(String productId) id
of the Product.void
setQuantity
(Long quantity) Number of Line Items to add to the Cart.void
setShippingDetails
(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.void
sku
of the ProductVariant.void
setSupplyChannel
(ChannelResourceIdentifier supplyChannel) Used to identify Inventory entries that must be reserved.void
setVariantId
(Long variantId) id
of the ProductVariant in the Product.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
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.me.MyCartAddLineItemAction
withMyCartAddLineItemAction
Methods inherited from interface com.commercetools.api.models.me.MyCartUpdateAction
withMyCartUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Constructor Details
-
MyCartAddLineItemActionImpl
public MyCartAddLineItemActionImpl()create empty instance
-
-
Method Details
-
getAction
- Specified by:
getAction
in interfaceMyCartUpdateAction
- Specified by:
getAction
in interfaceResourceUpdateAction<MyCartUpdateAction>
- Returns:
- action
-
getKey
User-defined unique identifier of the LineItem.
- Specified by:
getKey
in interfaceMyCartAddLineItemAction
- Returns:
- key
-
getProductId
id
of the Product.Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
getProductId
in interfaceMyCartAddLineItemAction
- Returns:
- productId
-
getVariantId
id
of the ProductVariant in the Product.If not given, the Master Variant is used.
Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
getVariantId
in interfaceMyCartAddLineItemAction
- Returns:
- variantId
-
getSku
sku
of the ProductVariant.Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
getSku
in interfaceMyCartAddLineItemAction
- Returns:
- sku
-
getQuantity
Number of Line Items to add to the Cart.
- Specified by:
getQuantity
in interfaceMyCartAddLineItemAction
- Returns:
- quantity
-
getAddedAt
Date and time (UTC) the Line Item was added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Specified by:
getAddedAt
in interfaceMyCartAddLineItemAction
- Returns:
- addedAt
-
getDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum. If the Cart is bound to a Store withdistributionChannels
set, the Channel must match one of the Store's distribution channels.- Specified by:
getDistributionChannel
in interfaceMyCartAddLineItemAction
- Returns:
- distributionChannel
-
getSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Specified by:
getSupplyChannel
in interfaceMyCartAddLineItemAction
- Returns:
- supplyChannel
-
getShippingDetails
Container for Line Item-specific addresses.
- Specified by:
getShippingDetails
in interfaceMyCartAddLineItemAction
- Returns:
- shippingDetails
-
getCustom
Custom Fields for the Line Item.
- Specified by:
getCustom
in interfaceCustomizableDraft<MyCartAddLineItemAction>
- Specified by:
getCustom
in interfaceMyCartAddLineItemAction
- Returns:
- custom
-
setKey
Description copied from interface:MyCartAddLineItemAction
User-defined unique identifier of the LineItem.
- Specified by:
setKey
in interfaceMyCartAddLineItemAction
- Parameters:
key
- value to be set
-
setProductId
Description copied from interface:MyCartAddLineItemAction
id
of the Product.Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
setProductId
in interfaceMyCartAddLineItemAction
- Parameters:
productId
- value to be set
-
setVariantId
Description copied from interface:MyCartAddLineItemAction
id
of the ProductVariant in the Product.If not given, the Master Variant is used.
Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
setVariantId
in interfaceMyCartAddLineItemAction
- Parameters:
variantId
- value to be set
-
setSku
Description copied from interface:MyCartAddLineItemAction
sku
of the ProductVariant.Either the
productId
andvariantId
, orsku
must be provided.- Specified by:
setSku
in interfaceMyCartAddLineItemAction
- Parameters:
sku
- value to be set
-
setQuantity
Description copied from interface:MyCartAddLineItemAction
Number of Line Items to add to the Cart.
- Specified by:
setQuantity
in interfaceMyCartAddLineItemAction
- Parameters:
quantity
- value to be set
-
setAddedAt
Description copied from interface:MyCartAddLineItemAction
Date and time (UTC) the Line Item was added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Specified by:
setAddedAt
in interfaceMyCartAddLineItemAction
- Parameters:
addedAt
- value to be set
-
setDistributionChannel
Description copied from interface:MyCartAddLineItemAction
Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum. If the Cart is bound to a Store withdistributionChannels
set, the Channel must match one of the Store's distribution channels.- Specified by:
setDistributionChannel
in interfaceMyCartAddLineItemAction
- Parameters:
distributionChannel
- value to be set
-
setSupplyChannel
Description copied from interface:MyCartAddLineItemAction
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Specified by:
setSupplyChannel
in interfaceMyCartAddLineItemAction
- Parameters:
supplyChannel
- value to be set
-
setShippingDetails
Description copied from interface:MyCartAddLineItemAction
Container for Line Item-specific addresses.
- Specified by:
setShippingDetails
in interfaceMyCartAddLineItemAction
- Parameters:
shippingDetails
- value to be set
-
setCustom
Description copied from interface:MyCartAddLineItemAction
Custom Fields for the Line Item.
- Specified by:
setCustom
in interfaceCustomizableDraft<MyCartAddLineItemAction>
- Specified by:
setCustom
in interfaceMyCartAddLineItemAction
- Parameters:
custom
- value to be set
-
equals
-
hashCode
-