Class PriceCompositeId
- java.lang.Object
-
- com.commercetools.sync.internals.helpers.PriceCompositeId
-
public final class PriceCompositeId extends java.lang.ObjectThis 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 booleanequals(java.lang.Object otherObject)java.lang.StringgetChannelId()com.neovisionaries.i18n.CountryCodegetCountryCode()java.lang.StringgetCurrencyCode()java.lang.StringgetCustomerGroupId()java.time.ZonedDateTimegetValidFrom()java.time.ZonedDateTimegetValidUntil()inthashCode()static PriceCompositeIdof(io.sphere.sdk.products.Price price)Given aPrice, creates aPriceCompositeIdusing 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 PriceCompositeIdof(io.sphere.sdk.products.PriceDraft priceDraft)Given aPriceDraft, creates aPriceCompositeIdusing 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 io.sphere.sdk.products.PriceDraft priceDraft)
Given aPriceDraft, creates aPriceCompositeIdusing 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 io.sphere.sdk.products.Price price)
Given aPrice, creates aPriceCompositeIdusing 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 com.neovisionaries.i18n.CountryCode 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-