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 ScopedPriceBuilderbuilder()builder factory method for ScopedPricestatic ScopedPriceBuilderbuilder(ScopedPrice template) create builder for ScopedPrice instancecopyDeep()static ScopedPricedeepCopy(ScopedPrice template) factory method to create a deep copy of ScopedPrice@Valid ChannelReferenceReference to a Channel.Country code of the geographic location.@NotNull @Valid TypedMoneyIf available, either the original pricevalueordiscountedvalue.@Valid CustomFieldsCustom Fields for the Price.@Valid CustomerGroupReferenceReference to a CustomerGroup.@Valid DiscountedPriceIs set when a matching ProductDiscount exists.@NotNull StringgetId()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 TypedMoneygetValue()Original value of the Price.static ScopedPriceof()factory methodstatic ScopedPriceof(ScopedPrice template) factory method to create a shallow copy ScopedPricevoidsetChannel(ChannelReference channel) Reference to a Channel.voidsetCountry(String country) Country code of the geographic location.voidsetCurrentValue(TypedMoney currentValue) If available, either the original pricevalueordiscountedvalue.voidsetCustom(CustomFields custom) Custom Fields for the Price.voidsetCustomerGroup(CustomerGroupReference customerGroup) Reference to a CustomerGroup.voidsetDiscounted(DiscountedPrice discounted) Is set when a matching ProductDiscount exists.voidPlatform-generated unique identifier of the Price.voidsetValidFrom(ZonedDateTime validFrom) Date and time from which the Price is valid.voidsetValidUntil(ZonedDateTime validUntil) Date and time until which the Price is valid.voidsetValue(TypedMoney value) Original value of the Price.static com.fasterxml.jackson.core.type.TypeReference<ScopedPrice>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithScopedPrice(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
valueordiscountedvalue.- 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:
getCustomin 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
valueordiscountedvalue.- 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:
setCustomin 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
-
copyDeep
ScopedPrice copyDeep() -
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
-