Interface ScopedPrice
- All Superinterfaces:
Customizable<ScopedPrice>
Scoped Price is contained in a ProductVariant which is returned in response to a Product Projection Search request when Scoped Price Search is used.
Example to create an instance using the builder pattern
ScopedPrice scopedPrice = ScopedPrice.builder()
.id("{id}")
.value(valueBuilder -> valueBuilder)
.currentValue(currentValueBuilder -> currentValueBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScopedPriceBuilder
builder()
builder factory method for ScopedPricestatic ScopedPriceBuilder
builder
(ScopedPrice template) create builder for ScopedPrice instancestatic ScopedPrice
deepCopy
(ScopedPrice template) factory method to create a deep copy of ScopedPrice@Valid ChannelReference
Reference to a Channel.Country code of the geographic location.@NotNull @Valid TypedMoney
If available, either the original pricevalue
ordiscounted
value.@Valid CustomFields
Custom Fields for the Price.@Valid CustomerGroupReference
Reference to a CustomerGroup.@Valid DiscountedPrice
Is set when a matching ProductDiscount exists.@NotNull String
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.@NotNull @Valid TypedMoney
getValue()
Original value of the Price.static ScopedPrice
of()
factory methodstatic ScopedPrice
of
(ScopedPrice template) factory method to create a shallow copy ScopedPricevoid
setChannel
(ChannelReference channel) Reference to a Channel.void
setCountry
(String country) Country code of the geographic location.void
setCurrentValue
(TypedMoney currentValue) If available, either the original pricevalue
ordiscounted
value.void
setCustom
(CustomFields custom) Custom Fields for the Price.void
setCustomerGroup
(CustomerGroupReference customerGroup) Reference to a CustomerGroup.void
setDiscounted
(DiscountedPrice discounted) Is set when a matching ProductDiscount exists.void
Platform-generated unique identifier of the Price.void
setValidFrom
(ZonedDateTime validFrom) Date and time from which the Price is valid.void
setValidUntil
(ZonedDateTime validUntil) Date and time until which the Price is valid.void
setValue
(TypedMoney value) Original value of the Price.static com.fasterxml.jackson.core.type.TypeReference<ScopedPrice>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withScopedPrice
(Function<ScopedPrice, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
-
Method Details
-
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
String getCountry()Country code of the geographic location.
- Returns:
- country
-
getCustomerGroup
Reference to a CustomerGroup.
- Returns:
- customerGroup
-
getChannel
Reference to a Channel.
- Returns:
- channel
-
getValidFrom
ZonedDateTime getValidFrom()Date and time from which the Price is valid.
- Returns:
- validFrom
-
getValidUntil
ZonedDateTime 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.
- Specified by:
getCustom
in interfaceCustomizable<ScopedPrice>
- Returns:
- custom
-
setId
Platform-generated unique identifier of the Price.
- Parameters:
id
- value to be set
-
setValue
Original value of the Price.
- Parameters:
value
- value to be set
-
setCurrentValue
If available, either the original price
value
ordiscounted
value.- Parameters:
currentValue
- value to be set
-
setCountry
Country code of the geographic location.
- Parameters:
country
- value to be set
-
setCustomerGroup
Reference to a CustomerGroup.
- Parameters:
customerGroup
- value to be set
-
setChannel
Reference to a Channel.
- Parameters:
channel
- value to be set
-
setValidFrom
Date and time from which the Price is valid.
- Parameters:
validFrom
- value to be set
-
setValidUntil
Date and time until which the Price is valid.
- Parameters:
validUntil
- value to be set
-
setDiscounted
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
-
setCustom
Custom Fields for the Price.
- Specified by:
setCustom
in interfaceCustomizable<ScopedPrice>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of ScopedPrice
-
of
factory method to create a shallow copy ScopedPrice- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ScopedPrice- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ScopedPrice- Returns:
- builder
-
builder
create builder for ScopedPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withScopedPrice
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
-