Interface ProductDiscountDraft
- All Superinterfaces:
Draft<ProductDiscountDraft>
,WithKey
Example to create an instance using the builder pattern
ProductDiscountDraft productDiscountDraft = ProductDiscountDraft.builder()
.name(nameBuilder -> nameBuilder)
.value(valueBuilder -> valueBuilder)
.predicate("{predicate}")
.sortOrder("{sortOrder}")
.isActive(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDiscountDraftBuilder
builder()
builder factory method for ProductDiscountDraftstatic ProductDiscountDraftBuilder
builder
(ProductDiscountDraft template) create builder for ProductDiscountDraft instancestatic ProductDiscountDraft
deepCopy
(ProductDiscountDraft template) factory method to create a deep copy of ProductDiscountDraft@Valid LocalizedString
Description of the ProductDiscount.@NotNull Boolean
Set totrue
to activate the ProductDiscount, set tofalse
to deactivate it (even though thepredicate
matches).getKey()
User-defined unique identifier for the ProductDiscount.@NotNull @Valid LocalizedString
getName()
Name of the ProductDiscount.@NotNull String
Valid ProductDiscount predicate.@NotNull String
Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active.Date and time (UTC) from which the Discount is effective.Date and time (UTC) until which the Discount is effective.@NotNull @Valid ProductDiscountValueDraft
getValue()
Type of Discount and its corresponding value.static ProductDiscountDraft
of()
factory methodstatic ProductDiscountDraft
of
(ProductDiscountDraft template) factory method to create a shallow copy ProductDiscountDraftvoid
setDescription
(LocalizedString description) Description of the ProductDiscount.void
setIsActive
(Boolean isActive) Set totrue
to activate the ProductDiscount, set tofalse
to deactivate it (even though thepredicate
matches).void
User-defined unique identifier for the ProductDiscount.void
setName
(LocalizedString name) Name of the ProductDiscount.void
setPredicate
(String predicate) Valid ProductDiscount predicate.void
setSortOrder
(String sortOrder) Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active.void
setValidFrom
(ZonedDateTime validFrom) Date and time (UTC) from which the Discount is effective.void
setValidUntil
(ZonedDateTime validUntil) Date and time (UTC) until which the Discount is effective.void
Type of Discount and its corresponding value.static com.fasterxml.jackson.core.type.TypeReference<ProductDiscountDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductDiscountDraft
(Function<ProductDiscountDraft, T> helper) accessor map function
-
Method Details
-
getName
Name of the ProductDiscount.
- Returns:
- name
-
getKey
String getKey()User-defined unique identifier for the ProductDiscount.
-
getDescription
Description of the ProductDiscount.
- Returns:
- description
-
getValue
Type of Discount and its corresponding value.
- Returns:
- value
-
getPredicate
Valid ProductDiscount predicate.
- Returns:
- predicate
-
getSortOrder
Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher
sortOrder
is prioritized. The value must be unique among all ProductDiscounts in the Project.- Returns:
- sortOrder
-
getIsActive
Set to
true
to activate the ProductDiscount, set tofalse
to deactivate it (even though thepredicate
matches).- Returns:
- isActive
-
getValidFrom
ZonedDateTime getValidFrom()Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Returns:
- validUntil
-
setName
Name of the ProductDiscount.
- Parameters:
name
- value to be set
-
setKey
User-defined unique identifier for the ProductDiscount.
- Parameters:
key
- value to be set
-
setDescription
Description of the ProductDiscount.
- Parameters:
description
- value to be set
-
setValue
Type of Discount and its corresponding value.
- Parameters:
value
- value to be set
-
setPredicate
Valid ProductDiscount predicate.
- Parameters:
predicate
- value to be set
-
setSortOrder
Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher
sortOrder
is prioritized. The value must be unique among all ProductDiscounts in the Project.- Parameters:
sortOrder
- value to be set
-
setIsActive
Set to
true
to activate the ProductDiscount, set tofalse
to deactivate it (even though thepredicate
matches).- Parameters:
isActive
- value to be set
-
setValidFrom
Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Parameters:
validFrom
- value to be set
-
setValidUntil
Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Parameters:
validUntil
- value to be set
-
of
factory method- Returns:
- instance of ProductDiscountDraft
-
of
factory method to create a shallow copy ProductDiscountDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductDiscountDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductDiscountDraft- Returns:
- builder
-
builder
create builder for ProductDiscountDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductDiscountDraft
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
-