Class CustomLineItemImpl
- All Implemented Interfaces:
CustomLineItem
,Customizable<CustomLineItem>
,io.vrap.rmf.base.client.ModelBase
A generic item that can be added to the Cart but is not bound to a Product that can be used for discounts (negative money), vouchers, complex cart rules, additional services, or fees. You control the lifecycle of this item.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Custom Fields of the Custom Line Item.Discounted price of a single quantity of the Custom Line Item.getId()
Unique identifier of the Custom Line Item.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.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.Number of Custom Line Items in the Cart or Order.Container for Custom Line Item-specific addresses.getSlug()
User-defined identifier used in a deep-link URL for the Custom Line Item.getState()
State of the Custom Line Item in the Cart or Order.Used to select a Tax Rate when a Cart has thePlatform
TaxMode.Automatically set after thetaxRate
is set.Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.For a Cart withPlatform
TaxMode, thetaxRate
of Custom Line Items is set automatically once a shipping address is set.Total price of the Custom Line Item (money
multiplied byquantity
).int
hashCode()
void
setCustom
(CustomFields custom) Custom Fields of the Custom Line Item.void
setDiscountedPricePerQuantity
(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Custom Line Item.void
setDiscountedPricePerQuantity
(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Discounted price of a single quantity of the Custom Line Item.void
Unique identifier of the Custom Line Item.void
User-defined unique identifier of the Custom Line Item.void
setMoney
(TypedMoney money) Money value of the Custom Line Item.void
setName
(LocalizedString name) Name of the Custom Line Item.void
setPerMethodTaxRate
(MethodTaxRate... perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.void
setPerMethodTaxRate
(List<MethodTaxRate> perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.void
setPriceMode
(CustomLineItemPriceMode priceMode) Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.void
setQuantity
(Long quantity) Number of Custom Line Items in the Cart or Order.void
setShippingDetails
(ItemShippingDetails 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 Item in the Cart or Order.void
State of the Custom Line Item in the Cart or Order.void
setTaxCategory
(TaxCategoryReference taxCategory) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.void
setTaxedPrice
(TaxedItemPrice taxedPrice) Automatically set after thetaxRate
is set.void
setTaxedPricePortions
(MethodTaxedPrice... taxedPricePortions) Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.void
setTaxedPricePortions
(List<MethodTaxedPrice> taxedPricePortions) Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.void
setTaxRate
(TaxRate taxRate) For a Cart withPlatform
TaxMode, thetaxRate
of Custom Line Items is set automatically once a shipping address is set.void
setTotalPrice
(CentPrecisionMoney totalPrice) Total price of the Custom Line Item (money
multiplied byquantity
).Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods inherited from interface com.commercetools.api.models.cart.CustomLineItem
withCustomLineItem
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
-
Constructor Details
-
CustomLineItemImpl
public CustomLineItemImpl()create empty instance
-
-
Method Details
-
getId
Unique identifier of the Custom Line Item.
- Specified by:
getId
in interfaceCustomLineItem
- Returns:
- id
-
getKey
User-defined unique identifier of the Custom Line Item.
- Specified by:
getKey
in interfaceCustomLineItem
- Returns:
- key
-
getName
Name of the Custom Line Item.
- Specified by:
getName
in interfaceCustomLineItem
- Returns:
- name
-
getMoney
Money value of the Custom Line Item.
- Specified by:
getMoney
in interfaceCustomLineItem
- Returns:
- money
-
getTaxedPrice
Automatically set after the
taxRate
is set.- Specified by:
getTaxedPrice
in interfaceCustomLineItem
- Returns:
- taxedPrice
-
getTaxedPricePortions
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
getTaxedPricePortions
in interfaceCustomLineItem
- Returns:
- taxedPricePortions
-
getTotalPrice
Total price of the Custom Line Item (
money
multiplied byquantity
). If the Custom Line Item is discounted, the total price isdiscountedPricePerQuantity
multiplied byquantity
.Includes taxes if the TaxRate
includedInPrice
istrue
.- Specified by:
getTotalPrice
in interfaceCustomLineItem
- Returns:
- totalPrice
-
getSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. It matches the pattern
[a-zA-Z0-9_-]{2,256}
.- Specified by:
getSlug
in interfaceCustomLineItem
- Returns:
- slug
-
getQuantity
Number of Custom Line Items in the Cart or Order.
- Specified by:
getQuantity
in interfaceCustomLineItem
- Returns:
- quantity
-
getState
State of the Custom Line Item in the Cart or Order.
- Specified by:
getState
in interfaceCustomLineItem
- Returns:
- state
-
getTaxCategory
Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Specified by:
getTaxCategory
in interfaceCustomLineItem
- Returns:
- taxCategory
-
getTaxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Custom Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Custom Line Items can be set using ExternalTaxRateDraft.
- Specified by:
getTaxRate
in interfaceCustomLineItem
- Returns:
- taxRate
- For a Cart with
-
getPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
getPerMethodTaxRate
in interfaceCustomLineItem
- Returns:
- perMethodTaxRate
-
getDiscountedPricePerQuantity
Discounted price of a single quantity of the Custom Line Item.
- Specified by:
getDiscountedPricePerQuantity
in interfaceCustomLineItem
- Returns:
- discountedPricePerQuantity
-
getCustom
Custom Fields of the Custom Line Item.
- Specified by:
getCustom
in interfaceCustomizable<CustomLineItem>
- Specified by:
getCustom
in interfaceCustomLineItem
- Returns:
- custom
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Specified by:
getShippingDetails
in interfaceCustomLineItem
- Returns:
- shippingDetails
-
getPriceMode
Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
- Specified by:
getPriceMode
in interfaceCustomLineItem
- Returns:
- priceMode
-
setId
Description copied from interface:CustomLineItem
Unique identifier of the Custom Line Item.
- Specified by:
setId
in interfaceCustomLineItem
- Parameters:
id
- value to be set
-
setKey
Description copied from interface:CustomLineItem
User-defined unique identifier of the Custom Line Item.
- Specified by:
setKey
in interfaceCustomLineItem
- Parameters:
key
- value to be set
-
setName
Description copied from interface:CustomLineItem
Name of the Custom Line Item.
- Specified by:
setName
in interfaceCustomLineItem
- Parameters:
name
- value to be set
-
setMoney
Description copied from interface:CustomLineItem
Money value of the Custom Line Item.
- Specified by:
setMoney
in interfaceCustomLineItem
- Parameters:
money
- value to be set
-
setTaxedPrice
Description copied from interface:CustomLineItem
Automatically set after the
taxRate
is set.- Specified by:
setTaxedPrice
in interfaceCustomLineItem
- Parameters:
taxedPrice
- value to be set
-
setTaxedPricePortions
Description copied from interface:CustomLineItem
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
setTaxedPricePortions
in interfaceCustomLineItem
- Parameters:
taxedPricePortions
- values to be set
-
setTaxedPricePortions
Description copied from interface:CustomLineItem
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
setTaxedPricePortions
in interfaceCustomLineItem
- Parameters:
taxedPricePortions
- values to be set
-
setTotalPrice
Description copied from interface:CustomLineItem
Total price of the Custom Line Item (
money
multiplied byquantity
). If the Custom Line Item is discounted, the total price isdiscountedPricePerQuantity
multiplied byquantity
.Includes taxes if the TaxRate
includedInPrice
istrue
.- Specified by:
setTotalPrice
in interfaceCustomLineItem
- Parameters:
totalPrice
- value to be set
-
setSlug
Description copied from interface:CustomLineItem
User-defined identifier used in a deep-link URL for the Custom Line Item. It matches the pattern
[a-zA-Z0-9_-]{2,256}
.- Specified by:
setSlug
in interfaceCustomLineItem
- Parameters:
slug
- value to be set
-
setQuantity
Description copied from interface:CustomLineItem
Number of Custom Line Items in the Cart or Order.
- Specified by:
setQuantity
in interfaceCustomLineItem
- Parameters:
quantity
- value to be set
-
setState
Description copied from interface:CustomLineItem
State of the Custom Line Item in the Cart or Order.
- Specified by:
setState
in interfaceCustomLineItem
- Parameters:
state
- values to be set
-
setState
Description copied from interface:CustomLineItem
State of the Custom Line Item in the Cart or Order.
- Specified by:
setState
in interfaceCustomLineItem
- Parameters:
state
- values to be set
-
setTaxCategory
Description copied from interface:CustomLineItem
Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Specified by:
setTaxCategory
in interfaceCustomLineItem
- Parameters:
taxCategory
- value to be set
-
setTaxRate
Description copied from interface:CustomLineItem
- For a Cart with
Platform
TaxMode, thetaxRate
of Custom Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Custom Line Items can be set using ExternalTaxRateDraft.
- Specified by:
setTaxRate
in interfaceCustomLineItem
- Parameters:
taxRate
- value to be set
- For a Cart with
-
setPerMethodTaxRate
Description copied from interface:CustomLineItem
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
setPerMethodTaxRate
in interfaceCustomLineItem
- Parameters:
perMethodTaxRate
- values to be set
-
setPerMethodTaxRate
Description copied from interface:CustomLineItem
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
setPerMethodTaxRate
in interfaceCustomLineItem
- Parameters:
perMethodTaxRate
- values to be set
-
setDiscountedPricePerQuantity
public void setDiscountedPricePerQuantity(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Description copied from interface:CustomLineItem
Discounted price of a single quantity of the Custom Line Item.
- Specified by:
setDiscountedPricePerQuantity
in interfaceCustomLineItem
- Parameters:
discountedPricePerQuantity
- values to be set
-
setDiscountedPricePerQuantity
public void setDiscountedPricePerQuantity(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Description copied from interface:CustomLineItem
Discounted price of a single quantity of the Custom Line Item.
- Specified by:
setDiscountedPricePerQuantity
in interfaceCustomLineItem
- Parameters:
discountedPricePerQuantity
- values to be set
-
setCustom
Description copied from interface:CustomLineItem
Custom Fields of the Custom Line Item.
- Specified by:
setCustom
in interfaceCustomizable<CustomLineItem>
- Specified by:
setCustom
in interfaceCustomLineItem
- Parameters:
custom
- value to be set
-
setShippingDetails
Description copied from interface:CustomLineItem
Container for Custom Line Item-specific addresses.
- Specified by:
setShippingDetails
in interfaceCustomLineItem
- Parameters:
shippingDetails
- value to be set
-
setPriceMode
Description copied from interface:CustomLineItem
Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
- Specified by:
setPriceMode
in interfaceCustomLineItem
- Parameters:
priceMode
- value to be set
-
equals
-
hashCode
-