Class PriceCompositeId
- java.lang.Object
-
- com.commercetools.sync.products.helpers.PriceCompositeId
-
public final class PriceCompositeId extends java.lang.Object
This class is only meant for the internal use of the commercetools-sync-java library.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object otherObject)
java.lang.String
getChannelId()
java.lang.String
getCountryCode()
java.lang.String
getCurrencyCode()
java.lang.String
getCustomerGroupId()
java.time.ZonedDateTime
getValidFrom()
java.time.ZonedDateTime
getValidUntil()
int
hashCode()
static PriceCompositeId
of(com.commercetools.api.models.common.Price price)
Given aPrice
, creates aPriceCompositeId
using the following fields from the suppliedPrice
:currencyCode
: CurrencyCode ofPrice.getValue()
countryCode
:Price.getCountry()
channelId
: id ofPrice.getChannel()
customerGroupId
: id ofPrice.getCustomerGroup()
validFrom
:Price.getValidFrom()
validUntil
:Price.getValidUntil()
static PriceCompositeId
of(com.commercetools.api.models.common.PriceDraft priceDraft)
Given aPriceDraft
, creates aPriceCompositeId
using the following fields from the suppliedPriceDraft
:currencyCode
: CurrencyCode ofPriceDraft.getValue()
countryCode
:PriceDraft.getCountry()
channelId
: id ofPriceDraft.getChannel()
customerGroupId
: id ofPriceDraft.getCustomerGroup()
validFrom
:PriceDraft.getValidFrom()
validUntil
:PriceDraft.getValidUntil()
-
-
-
Method Detail
-
of
@Nonnull public static PriceCompositeId of(@Nonnull com.commercetools.api.models.common.PriceDraft priceDraft)
Given aPriceDraft
, creates aPriceCompositeId
using the following fields from the suppliedPriceDraft
:currencyCode
: CurrencyCode ofPriceDraft.getValue()
countryCode
:PriceDraft.getCountry()
channelId
: id ofPriceDraft.getChannel()
customerGroupId
: id ofPriceDraft.getCustomerGroup()
validFrom
:PriceDraft.getValidFrom()
validUntil
:PriceDraft.getValidUntil()
- Parameters:
priceDraft
- a composite id is built using its fields.- Returns:
- a composite id comprised of the fields of the supplied
PriceDraft
.
-
of
@Nonnull public static PriceCompositeId of(@Nonnull com.commercetools.api.models.common.Price price)
Given aPrice
, creates aPriceCompositeId
using the following fields from the suppliedPrice
:currencyCode
: CurrencyCode ofPrice.getValue()
countryCode
:Price.getCountry()
channelId
: id ofPrice.getChannel()
customerGroupId
: id ofPrice.getCustomerGroup()
validFrom
:Price.getValidFrom()
validUntil
:Price.getValidUntil()
- Parameters:
price
- a composite id is built using its fields.- Returns:
- a composite id comprised of the fields of the supplied
Price
.
-
getCountryCode
public java.lang.String getCountryCode()
-
getCurrencyCode
public java.lang.String getCurrencyCode()
-
getChannelId
public java.lang.String getChannelId()
-
getCustomerGroupId
public java.lang.String getCustomerGroupId()
-
getValidFrom
public java.time.ZonedDateTime getValidFrom()
-
getValidUntil
public java.time.ZonedDateTime getValidUntil()
-
equals
public boolean equals(java.lang.Object otherObject)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-