Interface CartDiscountValueAbsoluteDraft
- All Superinterfaces:
CartDiscountValueDraft
,Draft<CartDiscountValueAbsoluteDraft>
Example to create an instance using the builder pattern
CartDiscountValueAbsoluteDraft cartDiscountValueAbsoluteDraft = CartDiscountValueAbsoluteDraft.builder()
.plusMoney(moneyBuilder -> moneyBuilder)
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for CartDiscountValueAbsoluteDraftbuilder
(CartDiscountValueAbsoluteDraft template) create builder for CartDiscountValueAbsoluteDraft instancedeepCopy
(CartDiscountValueAbsoluteDraft template) factory method to create a deep copy of CartDiscountValueAbsoluteDraftDetermines how the discount applies on CartDiscountLineItemTarget and CartDiscountCustomLineItemTarget.getMoney()
Money values in different currencies.of()
factory methodof
(CartDiscountValueAbsoluteDraft template) factory method to create a shallow copy CartDiscountValueAbsoluteDraftvoid
setApplicationMode
(DiscountApplicationMode applicationMode) Determines how the discount applies on CartDiscountLineItemTarget and CartDiscountCustomLineItemTarget.void
Money values in different currencies.void
Money values in different currencies.static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueAbsoluteDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountValueDraft
getType, withCartDiscountValueDraft
-
Field Details
-
ABSOLUTE
discriminator value for CartDiscountValueAbsoluteDraft- See Also:
-
-
Method Details
-
getMoney
Money values in different currencies. An absolute 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 decreased by 10€ and the matching $ price will be decreased by 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.
If the array is empty, the discount does not apply.
- Returns:
- money
-
getApplicationMode
DiscountApplicationMode getApplicationMode()Determines how the discount applies on CartDiscountLineItemTarget and CartDiscountCustomLineItemTarget.
If not set, the default behavior is
ProportionateDistribution
.- Returns:
- applicationMode
-
setMoney
Money values in different currencies. An absolute 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 decreased by 10€ and the matching $ price will be decreased by 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.
If the array is empty, the discount does not apply.
- Parameters:
money
- values to be set
-
setMoney
Money values in different currencies. An absolute 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 decreased by 10€ and the matching $ price will be decreased by 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.
If the array is empty, the discount does not apply.
- Parameters:
money
- values to be set
-
setApplicationMode
Determines how the discount applies on CartDiscountLineItemTarget and CartDiscountCustomLineItemTarget.
If not set, the default behavior is
ProportionateDistribution
.- Parameters:
applicationMode
- value to be set
-
of
factory method- Returns:
- instance of CartDiscountValueAbsoluteDraft
-
of
factory method to create a shallow copy CartDiscountValueAbsoluteDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static CartDiscountValueAbsoluteDraft deepCopy(@Nullable CartDiscountValueAbsoluteDraft template) factory method to create a deep copy of CartDiscountValueAbsoluteDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartDiscountValueAbsoluteDraft- Returns:
- builder
-
builder
create builder for CartDiscountValueAbsoluteDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCartDiscountValueAbsoluteDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueAbsoluteDraft> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-