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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTiers
(Function<PriceTierBuilder, PriceTier> builder) Maps toPrice.tiers
.build()
builds LineItemPrice with checking for non-null required valuesbuilds LineItemPrice without checking for non-null required valueschannel
(ChannelKeyReference channel) Maps toPrice.channel
.Maps toPrice.channel
.Maps toPrice.county
.Maps toPrice.custom
.custom
(Function<CustomBuilder, CustomBuilder> builder) Maps toPrice.custom
.customerGroup
(CustomerGroupKeyReference customerGroup) Maps toPrice.customerGroup
.Maps toPrice.customerGroup
.discounted
(DiscountedPrice discounted) Sets a discounted price from an external service.Sets a discounted price from an external service.Maps toPrice.channel
.Maps toPrice.county
.Maps toPrice.custom
.Maps toPrice.customerGroup
.Sets a discounted price from an external service.getTiers()
Maps toPrice.tiers
.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 instanceMaps toPrice.tiers
.plusTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) Maps toPrice.tiers
.setTiers
(Function<PriceTierBuilder, PriceTier> builder) Maps toPrice.tiers
.Maps toPrice.tiers
.Maps toPrice.tiers
.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
.Maps toPrice.channel
.withCustom
(Function<CustomBuilder, Custom> builder) Maps toPrice.custom
.Maps toPrice.customerGroup
.Sets a discounted price from an external service.withTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) Maps toPrice.tiers
.
-
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) Maps to
Price.customerGroup
. References a customer group by key. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public LineItemPriceBuilder withCustomerGroup(Function<CustomerGroupKeyReferenceBuilder, CustomerGroupKeyReference> builder) Maps to
Price.customerGroup
. References a customer group by key. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
Maps to
Price.customerGroup
. References a customer group by key. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Parameters:
customerGroup
- value to be set- Returns:
- Builder
-
channel
public LineItemPriceBuilder channel(Function<ChannelKeyReferenceBuilder, ChannelKeyReferenceBuilder> builder) Maps to
Price.channel
. References a channel by key. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
withChannel
public LineItemPriceBuilder withChannel(Function<ChannelKeyReferenceBuilder, ChannelKeyReference> builder) Maps to
Price.channel
. References a channel by key. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
channel
Maps to
Price.channel
. References a channel by key. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- 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
Maps to
Price.tiers
.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
tiers
Maps to
Price.tiers
.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
Maps to
Price.tiers
.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
Maps to
Price.tiers
.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
withTiers
Maps to
Price.tiers
.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
addTiers
Maps to
Price.tiers
.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
setTiers
Maps to
Price.tiers
.- 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
Maps to
Price.customerGroup
. References a customer group by key. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Returns:
- customerGroup
-
getChannel
Maps to
Price.channel
. References a channel by key. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Returns:
- channel
-
getDiscounted
Sets a discounted price from an external service.
- Returns:
- discounted
-
getTiers
Maps to
Price.tiers
.- 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
-