Interface StandalonePriceDraft
- All Superinterfaces:
CustomizableDraft<StandalonePriceDraft>
,io.vrap.rmf.base.client.Draft<StandalonePriceDraft>
,WithKey
- All Known Implementing Classes:
StandalonePriceDraftImpl
Standalone Prices are defined with a scope consisting of currency
and optionally country
, customerGroup
, and channel
and/or a validity period (validFrom
and/or validTo
). For more information see price selection.
Creating a Standalone Price for an SKU which has a Standalone Price with exactly the same price scope, or with overlapping validity periods within the same price scope returns the DuplicateStandalonePriceScope and OverlappingStandalonePriceValidity errors, respectively. A Price without validity period does not conflict with a Price defined for a time period.
Example to create an instance using the builder pattern
StandalonePriceDraft standalonePriceDraft = StandalonePriceDraft.builder()
.sku("{sku}")
.value(valueBuilder -> valueBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic StandalonePriceDraftBuilder
builder()
builder factory method for StandalonePriceDraftstatic StandalonePriceDraftBuilder
builder
(StandalonePriceDraft template) create builder for StandalonePriceDraft instancestatic StandalonePriceDraft
deepCopy
(StandalonePriceDraft template) factory method to create a deep copy of StandalonePriceDraftSet tofalse
, if the StandalonePrice should not be considered during price selection.@Valid ChannelResourceIdentifier
Sets the product distribution Channel for which this Price is valid.Sets the country for which this Price is valid.@Valid CustomFieldsDraft
Custom Fields for the StandalonePrice.Sets the CustomerGroup for which this Price is valid.@Valid DiscountedPriceDraft
Sets a discounted price for this Price that is different from the base price withvalue
.getKey()
User-defined unique identifier for the StandalonePrice.@NotNull String
getSku()
Specifies to which ProductVariant the API associates this Price.@Valid List<PriceTierDraft>
getTiers()
Sets price tiers.Sets the date from which the Price is valid.Sets the date until the Price is valid.@NotNull @Valid Money
getValue()
Sets the money value of this Price.static StandalonePriceDraft
of()
factory methodstatic StandalonePriceDraft
of
(StandalonePriceDraft template) factory method to create a shallow copy StandalonePriceDraftvoid
Set tofalse
, if the StandalonePrice should not be considered during price selection.void
setChannel
(ChannelResourceIdentifier channel) Sets the product distribution Channel for which this Price is valid.void
setCountry
(String country) Sets the country for which this Price is valid.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the StandalonePrice.void
setCustomerGroup
(CustomerGroupResourceIdentifier customerGroup) Sets the CustomerGroup for which this Price is valid.void
setDiscounted
(DiscountedPriceDraft discounted) Sets a discounted price for this Price that is different from the base price withvalue
.void
User-defined unique identifier for the StandalonePrice.void
Specifies to which ProductVariant the API associates this Price.void
setTiers
(PriceTierDraft... tiers) Sets price tiers.void
setTiers
(List<PriceTierDraft> tiers) Sets price tiers.void
setValidFrom
(ZonedDateTime validFrom) Sets the date from which the Price is valid.void
setValidUntil
(ZonedDateTime validUntil) Sets the date until the Price is valid.void
Sets the money value of this Price.static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withStandalonePriceDraft
(Function<StandalonePriceDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
User-defined unique identifier for the StandalonePrice.
-
getSku
Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.
- Returns:
- sku
-
getValue
Sets the money value of this Price.
- Returns:
- value
-
getCountry
Sets the country for which this Price is valid.
- Returns:
- country
-
getCustomerGroup
Sets the CustomerGroup for which this Price is valid.
- Returns:
- customerGroup
-
getChannel
Sets the product distribution Channel for which this Price is valid.
- Returns:
- channel
-
getValidFrom
Sets the date from which the Price is valid. Must be at least 1 ms earlier than
validUntil
.- Returns:
- validFrom
-
getValidUntil
Sets the date until the Price is valid. Must be at least 1 ms later than
validFrom
. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.- Returns:
- validUntil
-
getTiers
Sets price tiers.
- Returns:
- tiers
-
getDiscounted
Sets a discounted price for this Price that is different from the base price with
value
.- Returns:
- discounted
-
getCustom
Custom Fields for the StandalonePrice.
- Specified by:
getCustom
in interfaceCustomizableDraft<StandalonePriceDraft>
- Returns:
- custom
-
getActive
Set to
false
, if the StandalonePrice should not be considered during price selection.- Returns:
- active
-
setKey
User-defined unique identifier for the StandalonePrice.
- Parameters:
key
- value to be set
-
setSku
Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.
- Parameters:
sku
- value to be set
-
setValue
Sets the money value of this Price.
- Parameters:
value
- value to be set
-
setCountry
Sets the country for which this Price is valid.
- Parameters:
country
- value to be set
-
setCustomerGroup
Sets the CustomerGroup for which this Price is valid.
- Parameters:
customerGroup
- value to be set
-
setChannel
Sets the product distribution Channel for which this Price is valid.
- Parameters:
channel
- value to be set
-
setValidFrom
Sets the date from which the Price is valid. Must be at least 1 ms earlier than
validUntil
.- Parameters:
validFrom
- value to be set
-
setValidUntil
Sets the date until the Price is valid. Must be at least 1 ms later than
validFrom
. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.- Parameters:
validUntil
- value to be set
-
setTiers
Sets price tiers.
- Parameters:
tiers
- values to be set
-
setTiers
Sets price tiers.
- Parameters:
tiers
- values to be set
-
setDiscounted
Sets a discounted price for this Price that is different from the base price with
value
.- Parameters:
discounted
- value to be set
-
setCustom
Custom Fields for the StandalonePrice.
- Specified by:
setCustom
in interfaceCustomizableDraft<StandalonePriceDraft>
- Parameters:
custom
- value to be set
-
setActive
Set to
false
, if the StandalonePrice should not be considered during price selection.- Parameters:
active
- value to be set
-
of
factory method- Returns:
- instance of StandalonePriceDraft
-
of
factory method to create a shallow copy StandalonePriceDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of StandalonePriceDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StandalonePriceDraft- Returns:
- builder
-
builder
create builder for StandalonePriceDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStandalonePriceDraft
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
-