Interface ProductDiscountValueRelative
- All Superinterfaces:
ProductDiscountValue
Discounts the product price by a percentage, defined by the permyriad field.
Example to create an instance using the builder pattern
ProductDiscountValueRelative productDiscountValueRelative = ProductDiscountValueRelative.builder()
.permyriad(0.3)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for ProductDiscountValueRelativebuilder(ProductDiscountValueRelative template) create builder for ProductDiscountValueRelative instancecopyDeep()static ProductDiscountValueRelativedeepCopy(ProductDiscountValueRelative template) factory method to create a deep copy of ProductDiscountValueRelative@NotNull LongFraction (per ten thousand) the price is reduced by.static ProductDiscountValueRelativeof()factory methodstatic ProductDiscountValueRelativeof(ProductDiscountValueRelative template) factory method to create a shallow copy ProductDiscountValueRelativevoidsetPermyriad(Long permyriad) Fraction (per ten thousand) the price is reduced by.static com.fasterxml.jackson.core.type.TypeReference<ProductDiscountValueRelative>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.product_discount.ProductDiscountValue
getType, withProductDiscountValue
-
Field Details
-
RELATIVE
discriminator value for ProductDiscountValueRelative- 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
-
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
-
of
factory method- Returns:
- instance of ProductDiscountValueRelative
-
of
factory method to create a shallow copy ProductDiscountValueRelative- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductDiscountValueRelative copyDeep()- Specified by:
copyDeepin interfaceProductDiscountValue
-
deepCopy
@Nullable static ProductDiscountValueRelative deepCopy(@Nullable ProductDiscountValueRelative template) factory method to create a deep copy of ProductDiscountValueRelative- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductDiscountValueRelative- Returns:
- builder
-
builder
create builder for ProductDiscountValueRelative instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withProductDiscountValueRelative
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
-