Interface DiscountedPrice
public interface DiscountedPrice
DiscountedPrice
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedPrice discountedPrice = DiscountedPrice.builder()
.value(valueBuilder -> valueBuilder)
.discount(discountBuilder -> discountBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic DiscountedPriceBuilder
builder()
builder factory method for DiscountedPricestatic DiscountedPriceBuilder
builder
(DiscountedPrice template) create builder for DiscountedPrice instancestatic DiscountedPrice
deepCopy
(DiscountedPrice template) factory method to create a deep copy of DiscountedPrice@NotNull @Valid ProductDiscountKeyReference
Reference to a ProductDiscount.@NotNull @Valid TypedMoney
getValue()
Money value of the discounted price.static DiscountedPrice
of()
factory methodstatic DiscountedPrice
of
(DiscountedPrice template) factory method to create a shallow copy DiscountedPricevoid
setDiscount
(ProductDiscountKeyReference discount) Reference to a ProductDiscount.void
setValue
(TypedMoney value) Money value of the discounted price.static com.fasterxml.jackson.core.type.TypeReference<DiscountedPrice>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withDiscountedPrice
(Function<DiscountedPrice, T> helper) accessor map function
-
Method Details
-
getValue
Money value of the discounted price.
- Returns:
- value
-
getDiscount
Reference to a ProductDiscount.
- Returns:
- discount
-
setValue
Money value of the discounted price.
- Parameters:
value
- value to be set
-
setDiscount
Reference to a ProductDiscount.
- Parameters:
discount
- value to be set
-
of
factory method- Returns:
- instance of DiscountedPrice
-
of
factory method to create a shallow copy DiscountedPrice- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of DiscountedPrice- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DiscountedPrice- Returns:
- builder
-
builder
create builder for DiscountedPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDiscountedPrice
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
-