Class PriceBuilder
Example to create an instance using the builder pattern
Price price = Price.builder()
.id("{id}")
.value(valueBuilder -> valueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTiers
(Function<PriceTierBuilder, PriceTier> builder) Present if different Prices for certain LineItem quantities have been specified.build()
builds Price with checking for non-null required valuesbuilds Price without checking for non-null required valueschannel
(ChannelReference channel) ProductDistribution
Channel for which this Price is valid.ProductDistribution
Channel for which this Price is valid.Country for which this Price is valid.custom
(CustomFields custom) Custom Fields defined for the Price.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields defined for the Price.customerGroup
(CustomerGroupReference customerGroup) CustomerGroup for which this Price is valid.CustomerGroup for which this Price is valid.discounted
(DiscountedPrice discounted) Is set if a ProductDiscount has been applied.Is set if a ProductDiscount has been applied.ProductDistribution
Channel for which this Price is valid.Country for which this Price is valid.Custom Fields defined for the Price.CustomerGroup for which this Price is valid.Is set if a ProductDiscount has been applied.getId()
Unique identifier of this Price.getKey()
User-defined identifier of the Price.getTiers()
Present if different Prices for certain LineItem quantities have been specified.Date and time from which this Price is valid.Date and time until this Price is valid.getValue()
Money value of this Price.Unique identifier of this Price.User-defined identifier of the Price.static PriceBuilder
of()
factory method for an instance of PriceBuilderstatic PriceBuilder
create builder for Price instancePresent if different Prices for certain LineItem quantities have been specified.plusTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) Present if different Prices for certain LineItem quantities have been specified.setTiers
(Function<PriceTierBuilder, PriceTier> builder) Present if different Prices for certain LineItem quantities have been specified.Present if different Prices for certain LineItem quantities have been specified.Present if different Prices for certain LineItem quantities have been specified.validFrom
(ZonedDateTime validFrom) Date and time from which this Price is valid.validUntil
(ZonedDateTime validUntil) Date and time until this Price is valid.value
(TypedMoney value) Money value of this Price.value
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of this Price.ProductDistribution
Channel for which this Price is valid.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields defined for the Price.CustomerGroup for which this Price is valid.Is set if a ProductDiscount has been applied.withTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) Present if different Prices for certain LineItem quantities have been specified.
-
Constructor Details
-
PriceBuilder
public PriceBuilder()
-
-
Method Details
-
id
Unique identifier of this Price.
- Parameters:
id
- value to be set- Returns:
- Builder
-
key
User-defined identifier of the Price. It is unique per ProductVariant.
- Parameters:
key
- value to be set- Returns:
- Builder
-
value
Money value of this Price.
- Parameters:
value
- value to be set- Returns:
- Builder
-
value
Money value of this Price.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
country
Country for which this Price is valid.
- Parameters:
country
- value to be set- Returns:
- Builder
-
customerGroup
public PriceBuilder customerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReferenceBuilder> builder) CustomerGroup for which this Price is valid.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public PriceBuilder withCustomerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReference> builder) CustomerGroup for which this Price is valid.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
CustomerGroup for which this Price is valid.
- Parameters:
customerGroup
- value to be set- Returns:
- Builder
-
channel
ProductDistribution
Channel for which this Price is valid.- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
withChannel
ProductDistribution
Channel for which this Price is valid.- Parameters:
builder
- function to build the channel value- Returns:
- Builder
-
channel
ProductDistribution
Channel for which this Price is valid.- Parameters:
channel
- value to be set- Returns:
- Builder
-
validFrom
Date and time from which this Price is valid.
- Parameters:
validFrom
- value to be set- Returns:
- Builder
-
validUntil
Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.
- Parameters:
validUntil
- value to be set- Returns:
- Builder
-
discounted
Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice
value
is 0.5, thevalue
is rounded in favor of the customer with half-down rounding.- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
withDiscounted
Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice
value
is 0.5, thevalue
is rounded in favor of the customer with half-down rounding.- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
discounted
Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice
value
is 0.5, thevalue
is rounded in favor of the customer with half-down rounding.- Parameters:
discounted
- value to be set- Returns:
- Builder
-
tiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
tiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
withTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
addTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
setTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
custom
Custom Fields defined for the Price.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields defined for the Price.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields defined for the Price.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of this Price.
- Returns:
- id
-
getKey
User-defined identifier of the Price. It is unique per ProductVariant.
- Returns:
- key
-
getValue
Money value of this Price.
- Returns:
- value
-
getCountry
Country for which this Price is valid.
- Returns:
- country
-
getCustomerGroup
CustomerGroup for which this Price is valid.
- Returns:
- customerGroup
-
getChannel
ProductDistribution
Channel for which this Price is valid.- Returns:
- channel
-
getValidFrom
Date and time from which this Price is valid.
- Returns:
- validFrom
-
getValidUntil
Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.
- Returns:
- validUntil
-
getDiscounted
Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice
value
is 0.5, thevalue
is rounded in favor of the customer with half-down rounding.- Returns:
- discounted
-
getTiers
Present if different Prices for certain LineItem quantities have been specified.
If
discounted
is present, the tiered Price is ignored for a Product Variant.- Returns:
- tiers
-
getCustom
Custom Fields defined for the Price.
- Returns:
- custom
-
build
builds Price with checking for non-null required values -
buildUnchecked
builds Price without checking for non-null required values- Returns:
- Price
-
of
factory method for an instance of PriceBuilder- Returns:
- builder
-
of
create builder for Price instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-