Class LineItemPriceBuilder
- All Implemented Interfaces:
Builder<LineItemPrice>
Example to create an instance using the builder pattern
LineItemPrice lineItemPrice = LineItemPrice.builder()
.value(valueBuilder -> valueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTiers
(Function<PriceTierBuilder, PriceTier> builder) The tiered prices for this price.build()
builds LineItemPrice with checking for non-null required valuesbuilds LineItemPrice without checking for non-null required valueschannel
(ChannelKeyReference channel) References a channel by key.References a channel by key.Maps toPrice.county
.Maps toPrice.custom
.custom
(Function<CustomBuilder, CustomBuilder> builder) Maps toPrice.custom
.customerGroup
(CustomerGroupKeyReference customerGroup) References a customer group by key.References a customer group by key.discounted
(DiscountedPrice discounted) Sets a discounted price from an external service.Sets a discounted price from an external service.References a channel by key.Maps toPrice.county
.Maps toPrice.custom
.References a customer group by key.Sets a discounted price from an external service.getTiers()
The tiered prices for this price.Maps toPrice.validFrom
.Maps toPrice.validUntil
.getValue()
Maps toPrice.value
.static LineItemPriceBuilder
of()
factory method for an instance of LineItemPriceBuilderstatic LineItemPriceBuilder
of
(LineItemPrice template) create builder for LineItemPrice instanceThe tiered prices for this price.plusTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) The tiered prices for this price.setTiers
(Function<PriceTierBuilder, PriceTier> builder) The tiered prices for this price.The tiered prices for this price.The tiered prices for this price.validFrom
(ZonedDateTime validFrom) Maps toPrice.validFrom
.validUntil
(ZonedDateTime validUntil) Maps toPrice.validUntil
.value
(TypedMoney value) Maps toPrice.value
.value
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Maps toPrice.value
.References a channel by key.withCustom
(Function<CustomBuilder, Custom> builder) Maps toPrice.custom
.References a customer group by key.Sets a discounted price from an external service.withTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) The tiered prices for this price.
-
Constructor Details
-
LineItemPriceBuilder
public LineItemPriceBuilder()
-
-
Method Details
-
value
Maps to
Price.value
.- Parameters:
value
- value to be set- Returns:
- Builder
-
value
public LineItemPriceBuilder value(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Maps to
Price.value
.- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
country
Maps to
Price.county
.- Parameters:
country
- value to be set- Returns:
- Builder
-
validFrom
Maps to
Price.validFrom
.- Parameters:
validFrom
- value to be set- Returns:
- Builder
-
validUntil
Maps to
Price.validUntil
.- Parameters:
validUntil
- value to be set- Returns:
- Builder
-
customerGroup
public LineItemPriceBuilder customerGroup(Function<CustomerGroupKeyReferenceBuilder, CustomerGroupKeyReferenceBuilder> builder) References a customer group by key.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public LineItemPriceBuilder withCustomerGroup(Function<CustomerGroupKeyReferenceBuilder, CustomerGroupKeyReference> builder) References a customer group by key.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
References a customer group by key.
- Parameters:
customerGroup
- value to be set- Returns:
- Builder
-
channel
public LineItemPriceBuilder channel(Function<ChannelKeyReferenceBuilder, ChannelKeyReferenceBuilder> builder) References a channel by key.
- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
withChannel
public LineItemPriceBuilder withChannel(Function<ChannelKeyReferenceBuilder, ChannelKeyReference> builder) References a channel by key.
- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
channel
References a channel by key.
- Parameters:
channel
- value to be set- Returns:
- Builder
-
discounted
public LineItemPriceBuilder discounted(Function<DiscountedPriceBuilder, DiscountedPriceBuilder> builder) Sets a discounted price from an external service.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
withDiscounted
public LineItemPriceBuilder withDiscounted(Function<DiscountedPriceBuilder, DiscountedPrice> builder) Sets a discounted price from an external service.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
discounted
Sets a discounted price from an external service.
- Parameters:
discounted
- value to be set- Returns:
- Builder
-
tiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
tiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
withTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
addTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
setTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
custom
Maps to
Price.custom
.- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Maps to
Price.custom
.- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Maps to
Price.custom
.- Parameters:
custom
- value to be set- Returns:
- Builder
-
getValue
Maps to
Price.value
.- Returns:
- value
-
getCountry
Maps to
Price.county
.- Returns:
- country
-
getValidFrom
Maps to
Price.validFrom
.- Returns:
- validFrom
-
getValidUntil
Maps to
Price.validUntil
.- Returns:
- validUntil
-
getCustomerGroup
References a customer group by key.
- Returns:
- customerGroup
-
getChannel
References a channel by key.
- Returns:
- channel
-
getDiscounted
Sets a discounted price from an external service.
- Returns:
- discounted
-
getTiers
The tiered prices for this price.
- Returns:
- tiers
-
getCustom
Maps to
Price.custom
.- Returns:
- custom
-
build
builds LineItemPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<LineItemPrice>
- Returns:
- LineItemPrice
-
buildUnchecked
builds LineItemPrice without checking for non-null required values- Returns:
- LineItemPrice
-
of
factory method for an instance of LineItemPriceBuilder- Returns:
- builder
-
of
create builder for LineItemPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-