Class 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 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​(com.commercetools.api.models.common.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()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • of

        @Nonnull
        public static PriceCompositeId of​(@Nonnull
                                          com.commercetools.api.models.common.PriceDraft priceDraft)
        Given a PriceDraft, creates a PriceCompositeId using the following fields from the supplied PriceDraft:
        1. currencyCode: CurrencyCode of PriceDraft.getValue()
        2. countryCode: PriceDraft.getCountry()
        3. channelId: id of PriceDraft.getChannel()
        4. customerGroupId: id of PriceDraft.getCustomerGroup()
        5. validFrom: PriceDraft.getValidFrom()
        6. 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 a Price, creates a PriceCompositeId using the following fields from the supplied Price:
        1. currencyCode: CurrencyCode of Price.getValue()
        2. countryCode: Price.getCountry()
        3. channelId: id of Price.getChannel()
        4. customerGroupId: id of Price.getCustomerGroup()
        5. validFrom: Price.getValidFrom()
        6. 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object