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 ProductDiscountDraftBuilderbuilder()builder factory method for ProductDiscountDraftstatic ProductDiscountDraftBuilderbuilder(ProductDiscountDraft template) create builder for ProductDiscountDraft instancecopyDeep()static ProductDiscountDraftdeepCopy(ProductDiscountDraft template) factory method to create a deep copy of ProductDiscountDraft@Valid LocalizedStringDescription of the ProductDiscount.@NotNull BooleanSet totrueto activate the ProductDiscount, set tofalseto deactivate it (even though thepredicatematches).getKey()User-defined unique identifier for the ProductDiscount.@NotNull @Valid LocalizedStringgetName()Name of the ProductDiscount.@NotNull StringValid ProductDiscount predicate.@NotNull StringDecimal 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 ProductDiscountValueDraftgetValue()Type of Discount and its corresponding value.static ProductDiscountDraftof()factory methodstatic ProductDiscountDraftof(ProductDiscountDraft template) factory method to create a shallow copy ProductDiscountDraftvoidsetDescription(LocalizedString description) Description of the ProductDiscount.voidsetIsActive(Boolean isActive) Set totrueto activate the ProductDiscount, set tofalseto deactivate it (even though thepredicatematches).voidUser-defined unique identifier for the ProductDiscount.voidsetName(LocalizedString name) Name of the ProductDiscount.voidsetPredicate(String predicate) Valid ProductDiscount predicate.voidsetSortOrder(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.voidsetValidFrom(ZonedDateTime validFrom) Date and time (UTC) from which the Discount is effective.voidsetValidUntil(ZonedDateTime validUntil) Date and time (UTC) until which the Discount is effective.voidType of Discount and its corresponding value.static com.fasterxml.jackson.core.type.TypeReference<ProductDiscountDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductDiscountDraft(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
sortOrderis prioritized. The value must be unique among all ProductDiscounts in the Project.- Returns:
- sortOrder
-
getIsActive
Set to
trueto activate the ProductDiscount, set tofalseto deactivate it (even though thepredicatematches).- 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
sortOrderis prioritized. The value must be unique among all ProductDiscounts in the Project.- Parameters:
sortOrder- value to be set
-
setIsActive
Set to
trueto activate the ProductDiscount, set tofalseto deactivate it (even though thepredicatematches).- 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
-
copyDeep
ProductDiscountDraft copyDeep() -
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
-