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
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ProductDiscountValueRelativebuilder
(ProductDiscountValueRelative template) create builder for ProductDiscountValueRelative instancestatic ProductDiscountValueRelative
deepCopy
(ProductDiscountValueRelative template) factory method to create a deep copy of ProductDiscountValueRelative@NotNull Long
Fraction (per ten thousand) the price is reduced by.static ProductDiscountValueRelative
of()
factory methodstatic ProductDiscountValueRelative
of
(ProductDiscountValueRelative template) factory method to create a shallow copy ProductDiscountValueRelativevoid
setPermyriad
(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> T
accessor 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,
1000
will result in a 10% price reduction.- Returns:
- permyriad
-
setPermyriad
Fraction (per ten thousand) the price is reduced by. For example,
1000
will 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
-
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
-