Class ScopedPriceBuilder
- All Implemented Interfaces:
Builder<ScopedPrice>
Example to create an instance using the builder pattern
ScopedPrice scopedPrice = ScopedPrice.builder()
.id("{id}")
.value(valueBuilder -> valueBuilder)
.currentValue(currentValueBuilder -> currentValueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ScopedPrice with checking for non-null required valuesbuilds ScopedPrice without checking for non-null required valueschannel
(ChannelReference channel) Reference to a Channel.Reference to a Channel.Country code of the geographic location.currentValue
(TypedMoney currentValue) If available, either the original pricevalue
ordiscounted
value.currentValue
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) If available, either the original pricevalue
ordiscounted
value.custom
(CustomFields custom) Custom Fields for the Price.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields for the Price.customerGroup
(CustomerGroupReference customerGroup) Reference to a CustomerGroup.Reference to a CustomerGroup.discounted
(DiscountedPrice discounted) Is set when a matching ProductDiscount exists.Is set when a matching ProductDiscount exists.Reference to a Channel.Country code of the geographic location.If available, either the original pricevalue
ordiscounted
value.Custom Fields for the Price.Reference to a CustomerGroup.Is set when a matching ProductDiscount exists.getId()
Platform-generated unique identifier of the Price.Date and time from which the Price is valid.Date and time until which the Price is valid.getValue()
Original value of the Price.Platform-generated unique identifier of the Price.static ScopedPriceBuilder
of()
factory method for an instance of ScopedPriceBuilderstatic ScopedPriceBuilder
of
(ScopedPrice template) create builder for ScopedPrice instancevalidFrom
(ZonedDateTime validFrom) Date and time from which the Price is valid.validUntil
(ZonedDateTime validUntil) Date and time until which the Price is valid.value
(TypedMoney value) Original value of the Price.value
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Original value of the Price.Reference to a Channel.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields for the Price.Reference to a CustomerGroup.Is set when a matching ProductDiscount exists.
-
Constructor Details
-
ScopedPriceBuilder
public ScopedPriceBuilder()
-
-
Method Details
-
id
Platform-generated unique identifier of the Price.
- Parameters:
id
- value to be set- Returns:
- Builder
-
value
Original value of the Price.
- Parameters:
value
- value to be set- Returns:
- Builder
-
value
Original value of the Price.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
currentValue
If available, either the original price
value
ordiscounted
value.- Parameters:
currentValue
- value to be set- Returns:
- Builder
-
currentValue
public ScopedPriceBuilder currentValue(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) If available, either the original price
value
ordiscounted
value.- Parameters:
builder
- function to build the currentValue value- Returns:
- Builder
-
country
Country code of the geographic location.
- Parameters:
country
- value to be set- Returns:
- Builder
-
customerGroup
public ScopedPriceBuilder customerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReferenceBuilder> builder) Reference to a CustomerGroup.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public ScopedPriceBuilder withCustomerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReference> builder) Reference to a CustomerGroup.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
Reference to a CustomerGroup.
- Parameters:
customerGroup
- value to be set- Returns:
- Builder
-
channel
public ScopedPriceBuilder channel(Function<ChannelReferenceBuilder, ChannelReferenceBuilder> builder) Reference to a Channel.
- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
withChannel
Reference to a Channel.
- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
channel
Reference to a Channel.
- Parameters:
channel
- value to be set- Returns:
- Builder
-
validFrom
Date and time from which the Price is valid.
- Parameters:
validFrom
- value to be set- Returns:
- Builder
-
validUntil
Date and time until which the Price is valid.
- Parameters:
validUntil
- value to be set- Returns:
- Builder
-
discounted
public ScopedPriceBuilder discounted(Function<DiscountedPriceBuilder, DiscountedPriceBuilder> builder) Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.
When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
withDiscounted
Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.
When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
discounted
Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.
When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.
- Parameters:
discounted
- value to be set- Returns:
- Builder
-
custom
Custom Fields for the Price.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Price.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Price.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Platform-generated unique identifier of the Price.
- Returns:
- id
-
getValue
Original value of the Price.
- Returns:
- value
-
getCurrentValue
If available, either the original price
value
ordiscounted
value.- Returns:
- currentValue
-
getCountry
Country code of the geographic location.
- Returns:
- country
-
getCustomerGroup
Reference to a CustomerGroup.
- Returns:
- customerGroup
-
getChannel
Reference to a Channel.
- Returns:
- channel
-
getValidFrom
Date and time from which the Price is valid.
- Returns:
- validFrom
-
getValidUntil
Date and time until which the Price is valid.
- Returns:
- validUntil
-
getDiscounted
Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.
When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.
- Returns:
- discounted
-
getCustom
Custom Fields for the Price.
- Returns:
- custom
-
build
builds ScopedPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<ScopedPrice>
- Returns:
- ScopedPrice
-
buildUnchecked
builds ScopedPrice without checking for non-null required values- Returns:
- ScopedPrice
-
of
factory method for an instance of ScopedPriceBuilder- Returns:
- builder
-
of
create builder for ScopedPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-