Interface CartDiscountValueRelativeDraft
- All Superinterfaces:
CartDiscountValueDraft,Draft<CartDiscountValueRelativeDraft>
public interface CartDiscountValueRelativeDraft
extends CartDiscountValueDraft, Draft<CartDiscountValueRelativeDraft>
CartDiscountValueRelativeDraft
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartDiscountValueRelativeDraft cartDiscountValueRelativeDraft = CartDiscountValueRelativeDraft.builder()
.permyriad(0.3)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CartDiscountValueRelativeDraftbuilder(CartDiscountValueRelativeDraft template) create builder for CartDiscountValueRelativeDraft instancecopyDeep()deepCopy(CartDiscountValueRelativeDraft template) factory method to create a deep copy of CartDiscountValueRelativeDraftDetermines how the discount applies when using CartDiscountPatternTarget.@NotNull LongFraction (per ten thousand) the price is reduced by.of()factory methodof(CartDiscountValueRelativeDraft template) factory method to create a shallow copy CartDiscountValueRelativeDraftvoidsetApplicationMode(DiscountApplicationMode applicationMode) Determines how the discount applies when using CartDiscountPatternTarget.voidsetPermyriad(Long permyriad) Fraction (per ten thousand) the price is reduced by.static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueRelativeDraft>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
-
RELATIVE
discriminator value for CartDiscountValueRelativeDraft- See Also:
-
-
Method Details
-
getPermyriad
Fraction (per ten thousand) the price is reduced by. For example,
1000will result in a 10% price reduction.- Returns:
- permyriad
-
getApplicationMode
DiscountApplicationMode getApplicationMode()Determines how the discount applies when using CartDiscountPatternTarget.
- If the mode is
IndividualApplication, the discounted percentage is applied on each unit's price. The units matching thetriggerPatternare not considered. - If the mode is
ProportionateDistributionandEvenDistributionthe discounted value is calculated from the total value of the units matching thetargetPatternand distributed among the units matching thetargetPatternortriggerPattern. These modes are allowed only if CartDiscountPatternTargettriggerPatternis non-empty.
- Returns:
- applicationMode
- If the mode is
-
setPermyriad
Fraction (per ten thousand) the price is reduced by. For example,
1000will result in a 10% price reduction.- Parameters:
permyriad- value to be set
-
setApplicationMode
Determines how the discount applies when using CartDiscountPatternTarget.
- If the mode is
IndividualApplication, the discounted percentage is applied on each unit's price. The units matching thetriggerPatternare not considered. - If the mode is
ProportionateDistributionandEvenDistributionthe discounted value is calculated from the total value of the units matching thetargetPatternand distributed among the units matching thetargetPatternortriggerPattern. These modes are allowed only if CartDiscountPatternTargettriggerPatternis non-empty.
- Parameters:
applicationMode- value to be set
- If the mode is
-
of
factory method- Returns:
- instance of CartDiscountValueRelativeDraft
-
of
factory method to create a shallow copy CartDiscountValueRelativeDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CartDiscountValueRelativeDraft copyDeep()- Specified by:
copyDeepin interfaceCartDiscountValueDraft
-
deepCopy
@Nullable static CartDiscountValueRelativeDraft deepCopy(@Nullable CartDiscountValueRelativeDraft template) factory method to create a deep copy of CartDiscountValueRelativeDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartDiscountValueRelativeDraft- Returns:
- builder
-
builder
create builder for CartDiscountValueRelativeDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCartDiscountValueRelativeDraft
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<CartDiscountValueRelativeDraft> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-