Class PriceDraftImpl
- All Implemented Interfaces:
PriceDraft
,CustomizableDraft<PriceDraft>
,WithKey
,io.vrap.rmf.base.client.Draft<PriceDraft>
,io.vrap.rmf.base.client.ModelBase
The draft representation for prices to be embedded into ProductVariantDrafts when the ProductPriceMode is Embedded
. For the Standalone
ProductPriceMode use StandalonePriceDraft.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Set this field if this Price is only valid for the referencedProductDistribution
Channel.Set this field if this Price is only valid for the specified country.Custom Fields for the Price.Set this field if this Price is only valid for the referenced CustomerGroup.Set this field to add a DiscountedPrice from an external service.getKey()
User-defined identifier for the Price.getTiers()
Set this field to specify different Prices for certain LineItem quantities.Set this field if this Price is only valid from the specified date and time.Set this field if this Price is only valid until the specified date and time.getValue()
Money value of this Price.int
hashCode()
void
setChannel
(ChannelResourceIdentifier channel) Set this field if this Price is only valid for the referencedProductDistribution
Channel.void
setCountry
(String country) Set this field if this Price is only valid for the specified country.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Price.void
setCustomerGroup
(CustomerGroupResourceIdentifier customerGroup) Set this field if this Price is only valid for the referenced CustomerGroup.void
setDiscounted
(DiscountedPriceDraft discounted) Set this field to add a DiscountedPrice from an external service.void
User-defined identifier for the Price.void
setTiers
(PriceTierDraft... tiers) Set this field to specify different Prices for certain LineItem quantities.void
setTiers
(List<PriceTierDraft> tiers) Set this field to specify different Prices for certain LineItem quantities.void
setValidFrom
(ZonedDateTime validFrom) Set this field if this Price is only valid from the specified date and time.void
setValidUntil
(ZonedDateTime validUntil) Set this field if this Price is only valid until the specified date and time.void
Money value of this Price.toString()
Methods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.api.models.common.PriceDraft
withPriceDraft
-
Constructor Details
-
PriceDraftImpl
public PriceDraftImpl()create empty instance
-
-
Method Details
-
getKey
User-defined identifier for the Price. It must be unique per ProductVariant.
- Specified by:
getKey
in interfacePriceDraft
- Specified by:
getKey
in interfaceWithKey
- Returns:
- key
-
getValue
Money value of this Price.
- Specified by:
getValue
in interfacePriceDraft
- Returns:
- value
-
getCountry
Set this field if this Price is only valid for the specified country.
- Specified by:
getCountry
in interfacePriceDraft
- Returns:
- country
-
getCustomerGroup
Set this field if this Price is only valid for the referenced CustomerGroup.
- Specified by:
getCustomerGroup
in interfacePriceDraft
- Returns:
- customerGroup
-
getChannel
Set this field if this Price is only valid for the referenced
ProductDistribution
Channel.- Specified by:
getChannel
in interfacePriceDraft
- Returns:
- channel
-
getValidFrom
Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than
validUntil
.- Specified by:
getValidFrom
in interfacePriceDraft
- Returns:
- validFrom
-
getValidUntil
Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than
validFrom
. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.- Specified by:
getValidUntil
in interfacePriceDraft
- Returns:
- validUntil
-
getDiscounted
Set this field to add a DiscountedPrice from an external service.
Otherwise, Composable Commerce sets this field automatically if at least one ProductDiscount applies. The DiscountedPrice must reference a ProductDiscount with:
- The
isActive
flag set totrue
. - A ProductDiscountValue of type
external
. - A
predicate
that matches the ProductVariant the Price is referenced from.
- Specified by:
getDiscounted
in interfacePriceDraft
- Returns:
- discounted
- The
-
getTiers
Set this field to specify different Prices for certain LineItem quantities.
- Specified by:
getTiers
in interfacePriceDraft
- Returns:
- tiers
-
getCustom
Custom Fields for the Price.
- Specified by:
getCustom
in interfaceCustomizableDraft<PriceDraft>
- Specified by:
getCustom
in interfacePriceDraft
- Returns:
- custom
-
setKey
Description copied from interface:PriceDraft
User-defined identifier for the Price. It must be unique per ProductVariant.
- Specified by:
setKey
in interfacePriceDraft
- Parameters:
key
- value to be set
-
setValue
Description copied from interface:PriceDraft
Money value of this Price.
- Specified by:
setValue
in interfacePriceDraft
- Parameters:
value
- value to be set
-
setCountry
Description copied from interface:PriceDraft
Set this field if this Price is only valid for the specified country.
- Specified by:
setCountry
in interfacePriceDraft
- Parameters:
country
- value to be set
-
setCustomerGroup
Description copied from interface:PriceDraft
Set this field if this Price is only valid for the referenced CustomerGroup.
- Specified by:
setCustomerGroup
in interfacePriceDraft
- Parameters:
customerGroup
- value to be set
-
setChannel
Description copied from interface:PriceDraft
Set this field if this Price is only valid for the referenced
ProductDistribution
Channel.- Specified by:
setChannel
in interfacePriceDraft
- Parameters:
channel
- value to be set
-
setValidFrom
Description copied from interface:PriceDraft
Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than
validUntil
.- Specified by:
setValidFrom
in interfacePriceDraft
- Parameters:
validFrom
- value to be set
-
setValidUntil
Description copied from interface:PriceDraft
Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than
validFrom
. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.- Specified by:
setValidUntil
in interfacePriceDraft
- Parameters:
validUntil
- value to be set
-
setDiscounted
Description copied from interface:PriceDraft
Set this field to add a DiscountedPrice from an external service.
Otherwise, Composable Commerce sets this field automatically if at least one ProductDiscount applies. The DiscountedPrice must reference a ProductDiscount with:
- The
isActive
flag set totrue
. - A ProductDiscountValue of type
external
. - A
predicate
that matches the ProductVariant the Price is referenced from.
- Specified by:
setDiscounted
in interfacePriceDraft
- Parameters:
discounted
- value to be set
- The
-
setTiers
Description copied from interface:PriceDraft
Set this field to specify different Prices for certain LineItem quantities.
- Specified by:
setTiers
in interfacePriceDraft
- Parameters:
tiers
- values to be set
-
setTiers
Description copied from interface:PriceDraft
Set this field to specify different Prices for certain LineItem quantities.
- Specified by:
setTiers
in interfacePriceDraft
- Parameters:
tiers
- values to be set
-
setCustom
Description copied from interface:PriceDraft
Custom Fields for the Price.
- Specified by:
setCustom
in interfaceCustomizableDraft<PriceDraft>
- Specified by:
setCustom
in interfacePriceDraft
- Parameters:
custom
- value to be set
-
equals
-
hashCode
public int hashCode() -
toString
-