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 DiscountedPriceBuilderbuilder()builder factory method for DiscountedPricestatic DiscountedPriceBuilderbuilder(DiscountedPrice template) create builder for DiscountedPrice instancecopyDeep()static DiscountedPricedeepCopy(DiscountedPrice template) factory method to create a deep copy of DiscountedPrice@NotNull @Valid ProductDiscountReferenceProductDiscount related to the discounted price.@NotNull @Valid TypedMoneygetValue()Money value of the discounted price.static DiscountedPriceof()factory methodstatic DiscountedPriceof(DiscountedPrice template) factory method to create a shallow copy DiscountedPricevoidsetDiscount(ProductDiscountReference discount) ProductDiscount related to the discounted price.voidsetValue(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> TwithDiscountedPrice(Function<DiscountedPrice, T> helper) accessor map function
-
Method Details
-
getValue
Money value of the discounted price.
- Returns:
- value
-
getDiscount
ProductDiscount related to the discounted price.
- Returns:
- discount
-
setValue
Money value of the discounted price.
- Parameters:
value- value to be set
-
setDiscount
ProductDiscount related to the discounted price.
- 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
-
copyDeep
DiscountedPrice copyDeep() -
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
-