Interface StandalonePriceDraft
- All Superinterfaces:
CustomizableDraft<StandalonePriceDraft>
,Draft<StandalonePriceDraft>
,WithKey
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 Product 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 StagedPriceDraft
Staged changes for the StandalonePrice.@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 Product 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
setStaged
(StagedPriceDraft staged) Staged changes for the StandalonePrice.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
String 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.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- value
-
getCountry
String 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
ZonedDateTime getValidFrom()Sets the date from which the Price is valid. Must be at least 1 ms earlier than
validUntil
.- Returns:
- validFrom
-
getValidUntil
ZonedDateTime 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.
If
discounted
is set, the tiered Price is ignored for a Product Variant.- 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
-
getStaged
Staged changes for the StandalonePrice.
- Returns:
- staged
-
getActive
Boolean getActive()Set to
false
, if the StandalonePrice should not be considered during Product 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.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- 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.
If
discounted
is set, the tiered Price is ignored for a Product Variant.- Parameters:
tiers
- values to be set
-
setTiers
Sets price tiers.
If
discounted
is set, the tiered Price is ignored for a Product Variant.- 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
-
setStaged
Staged changes for the StandalonePrice.
- Parameters:
staged
- value to be set
-
setActive
Set to
false
, if the StandalonePrice should not be considered during Product 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
-