Interface DirectDiscount
public interface DirectDiscount
Represents a CartDiscount that is only associated with a single Cart or Order.
Example to create an instance using the builder pattern
DirectDiscount directDiscount = DirectDiscount.builder()
.id("{id}")
.value(valueBuilder -> valueBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic DirectDiscountBuilderbuilder()builder factory method for DirectDiscountstatic DirectDiscountBuilderbuilder(DirectDiscount template) create builder for DirectDiscount instancecopyDeep()static DirectDiscountdeepCopy(DirectDiscount template) factory method to create a deep copy of DirectDiscount@NotNull StringgetId()Unique identifier of the Direct Discount.@Valid CartDiscountTargetSegment of the Cart that is discounted.@NotNull @Valid CartDiscountValuegetValue()Effect of the Discount on the Cart.static DirectDiscountof()factory methodstatic DirectDiscountof(DirectDiscount template) factory method to create a shallow copy DirectDiscountvoidUnique identifier of the Direct Discount.voidsetTarget(CartDiscountTarget target) Segment of the Cart that is discounted.voidsetValue(CartDiscountValue value) Effect of the Discount on the Cart.static com.fasterxml.jackson.core.type.TypeReference<DirectDiscount>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithDirectDiscount(Function<DirectDiscount, T> helper) accessor map function
-
Method Details
-
getId
Unique identifier of the Direct Discount.
- Returns:
- id
-
getValue
Effect of the Discount on the Cart.
- Returns:
- value
-
getTarget
Segment of the Cart that is discounted.
Empty when the
valueis set togiftLineItem.- Returns:
- target
-
setId
Unique identifier of the Direct Discount.
- Parameters:
id- value to be set
-
setValue
Effect of the Discount on the Cart.
- Parameters:
value- value to be set
-
setTarget
Segment of the Cart that is discounted.
Empty when the
valueis set togiftLineItem.- Parameters:
target- value to be set
-
of
factory method- Returns:
- instance of DirectDiscount
-
of
factory method to create a shallow copy DirectDiscount- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
DirectDiscount copyDeep() -
deepCopy
factory method to create a deep copy of DirectDiscount- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DirectDiscount- Returns:
- builder
-
builder
create builder for DirectDiscount instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withDirectDiscount
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
-