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 DirectDiscountBuilder
builder()
builder factory method for DirectDiscountstatic DirectDiscountBuilder
builder
(DirectDiscount template) create builder for DirectDiscount instancestatic DirectDiscount
deepCopy
(DirectDiscount template) factory method to create a deep copy of DirectDiscount@NotNull String
getId()
Unique identifier of the Direct Discount.@Valid CartDiscountTarget
Segment of the Cart that is discounted.@NotNull @Valid CartDiscountValue
getValue()
Effect of the Discount on the Cart.static DirectDiscount
of()
factory methodstatic DirectDiscount
of
(DirectDiscount template) factory method to create a shallow copy DirectDiscountvoid
Unique identifier of the Direct Discount.void
setTarget
(CartDiscountTarget target) Segment of the Cart that is discounted.void
setValue
(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> T
withDirectDiscount
(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
value
is 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
value
is 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
-
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
-