Interface BestDeal
- All Superinterfaces:
DiscountTypeCombination
Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.
Example to create an instance using the builder pattern
BestDeal bestDeal = BestDeal.builder()
.chosenDiscountType("{chosenDiscountType}")
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BestDealBuilderbuilder()builder factory method for BestDealstatic BestDealBuildercreate builder for BestDeal instancecopyDeep()static BestDealfactory method to create a deep copy of BestDeal@NotNull StringDiscount type that offers the best deal; the value can beProductDiscountorCartDiscount.static BestDealof()factory methodstatic BestDealfactory method to create a shallow copy BestDealvoidsetChosenDiscountType(String chosenDiscountType) Discount type that offers the best deal; the value can beProductDiscountorCartDiscount.static com.fasterxml.jackson.core.type.TypeReference<BestDeal>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithBestDeal(Function<BestDeal, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.cart.DiscountTypeCombination
getType, withDiscountTypeCombination
-
Field Details
-
BEST_DEAL
discriminator value for BestDeal- See Also:
-
-
Method Details
-
getChosenDiscountType
Discount type that offers the best deal; the value can be
ProductDiscountorCartDiscount.- Returns:
- chosenDiscountType
-
setChosenDiscountType
Discount type that offers the best deal; the value can be
ProductDiscountorCartDiscount.- Parameters:
chosenDiscountType- value to be set
-
of
factory method- Returns:
- instance of BestDeal
-
of
factory method to create a shallow copy BestDeal- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
BestDeal copyDeep()- Specified by:
copyDeepin interfaceDiscountTypeCombination
-
deepCopy
factory method to create a deep copy of BestDeal- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for BestDeal- Returns:
- builder
-
builder
create builder for BestDeal instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withBestDeal
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
-