public final class PriceCompositeId
extends java.lang.Object
Since there is no one unique identifier for prices on the commercetools API, we uniquely identify a price as a composite id of the following fields: countryCode, currencyCode, channelId, customerGroupId, validFrom and validUntil. This class models such composite key.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object otherObject) |
java.lang.String |
getChannelId() |
com.neovisionaries.i18n.CountryCode |
getCountryCode() |
java.lang.String |
getCurrencyCode() |
java.lang.String |
getCustomerGroupId() |
java.time.ZonedDateTime |
getValidFrom() |
java.time.ZonedDateTime |
getValidUntil() |
int |
hashCode() |
static PriceCompositeId |
of(io.sphere.sdk.products.Price price)
Given a
Price , creates a PriceCompositeId using the following fields from the
supplied Price :
currencyCode : CurrencyCode of Price.getValue()
countryCode : Price.getCountry()
channelId : id of Price.getChannel()
customerGroupId : id of Price.getCustomerGroup()
validFrom : Price.getValidFrom()
validUntil : Price.getValidUntil()
|
static PriceCompositeId |
of(io.sphere.sdk.products.PriceDraft priceDraft)
Given a
PriceDraft , creates a PriceCompositeId using the following fields from
the supplied PriceDraft :
currencyCode : CurrencyCode of PriceDraft.getValue()
countryCode : PriceDraft.getCountry()
channelId : id of PriceDraft.getChannel()
customerGroupId : id of PriceDraft.getCustomerGroup()
validFrom : PriceDraft.getValidFrom()
validUntil : PriceDraft.getValidUntil()
|
@Nonnull public static PriceCompositeId of(@Nonnull io.sphere.sdk.products.PriceDraft priceDraft)
PriceDraft
, creates a PriceCompositeId
using the following fields from
the supplied PriceDraft
:
currencyCode
: CurrencyCode of PriceDraft.getValue()
countryCode
: PriceDraft.getCountry()
channelId
: id of PriceDraft.getChannel()
customerGroupId
: id of PriceDraft.getCustomerGroup()
validFrom
: PriceDraft.getValidFrom()
validUntil
: PriceDraft.getValidUntil()
priceDraft
- a composite id is built using its fields.PriceDraft
.@Nonnull public static PriceCompositeId of(@Nonnull io.sphere.sdk.products.Price price)
Price
, creates a PriceCompositeId
using the following fields from the
supplied Price
:
currencyCode
: CurrencyCode of Price.getValue()
countryCode
: Price.getCountry()
channelId
: id of Price.getChannel()
customerGroupId
: id of Price.getCustomerGroup()
validFrom
: Price.getValidFrom()
validUntil
: Price.getValidUntil()
price
- a composite id is built using its fields.Price
.public com.neovisionaries.i18n.CountryCode getCountryCode()
public java.lang.String getCurrencyCode()
public java.lang.String getChannelId()
public java.lang.String getCustomerGroupId()
public java.time.ZonedDateTime getValidFrom()
public java.time.ZonedDateTime getValidUntil()
public boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object