Interface CartDiscountValueFixedDraft
- All Superinterfaces:
CartDiscountValueDraft,Draft<CartDiscountValueFixedDraft>
Sets the DiscountedLineItemPrice of the CartDiscountLineItemsTarget or CartDiscountCustomLineItemsTarget to the value specified in the money field, if it is lower than the current Line Item price for the same currency. If the Line Item price is already discounted to a price equal to or lower than the respective price in the money field, this Discount is not applied.
Example to create an instance using the builder pattern
CartDiscountValueFixedDraft cartDiscountValueFixedDraft = CartDiscountValueFixedDraft.builder()
.plusMoney(moneyBuilder -> moneyBuilder)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CartDiscountValueFixedDraftbuilder(CartDiscountValueFixedDraft template) create builder for CartDiscountValueFixedDraft instancecopyDeep()static CartDiscountValueFixedDraftdeepCopy(CartDiscountValueFixedDraft template) factory method to create a deep copy of CartDiscountValueFixedDraftDetermines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.getMoney()Money values provided either in cent precision or high precision for different currencies.static CartDiscountValueFixedDraftof()factory methodstatic CartDiscountValueFixedDraftof(CartDiscountValueFixedDraft template) factory method to create a shallow copy CartDiscountValueFixedDraftvoidsetApplicationMode(DiscountApplicationMode applicationMode) Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.voidMoney values provided either in cent precision or high precision for different currencies.voidMoney values provided either in cent precision or high precision for different currencies.static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueFixedDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountValueDraft
getType, withCartDiscountValueDraft
-
Field Details
-
FIXED
discriminator value for CartDiscountValueFixedDraft- See Also:
-
-
Method Details
-
getMoney
Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Returns:
- money
-
getApplicationMode
DiscountApplicationMode getApplicationMode()Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.
For CartDiscountPatternTarget, you can also set the mode to
ProportionateDistributionorEvenDistribution.- Returns:
- applicationMode
-
setMoney
Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
money- values to be set
-
setMoney
Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
money- values to be set
-
setApplicationMode
Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.
For CartDiscountPatternTarget, you can also set the mode to
ProportionateDistributionorEvenDistribution.- Parameters:
applicationMode- value to be set
-
of
factory method- Returns:
- instance of CartDiscountValueFixedDraft
-
of
factory method to create a shallow copy CartDiscountValueFixedDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CartDiscountValueFixedDraft copyDeep()- Specified by:
copyDeepin interfaceCartDiscountValueDraft
-
deepCopy
@Nullable static CartDiscountValueFixedDraft deepCopy(@Nullable CartDiscountValueFixedDraft template) factory method to create a deep copy of CartDiscountValueFixedDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartDiscountValueFixedDraft- Returns:
- builder
-
builder
create builder for CartDiscountValueFixedDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCartDiscountValueFixedDraft
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
-