Class CustomObjectCompositeIdentifier
- java.lang.Object
-
- com.commercetools.sync.customobjects.helpers.CustomObjectCompositeIdentifier
-
public final class CustomObjectCompositeIdentifier 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 customObjects on the commercetools API, we uniquely identify a customObject as a composite id of the following fields: key, container. 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 obj)
java.lang.String
getContainer()
java.lang.String
getKey()
int
hashCode()
static CustomObjectCompositeIdentifier
of(com.commercetools.api.models.custom_object.CustomObject customObject)
Given aCustomObjectDraft
, creates aCustomObjectCompositeIdentifier
using the following fields from the suppliedCustomObject
:key
: key ofCustomObject.getKey()
container
: container ofCustomObject.getContainer()
static CustomObjectCompositeIdentifier
of(com.commercetools.api.models.custom_object.CustomObjectDraft customObjectDraft)
Given aCustomObjectDraft
, creates aCustomObjectCompositeIdentifier
using the following fields from the suppliedCustomObjectDraft
:key
: key ofCustomObjectDraft.getKey()
container
: container ofCustomObjectDraft.getContainer()
static CustomObjectCompositeIdentifier
of(java.lang.String identifierAsString)
Given aString
with a format "container|key", creates aCustomObjectCompositeIdentifier
using the following fields from the supplied identifier as string.static CustomObjectCompositeIdentifier
of(java.lang.String key, java.lang.String container)
Given aString
andString
, creates aCustomObjectCompositeIdentifier
using the following fields from the supplied attributes.java.lang.String
toString()
-
-
-
Method Detail
-
of
@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull com.commercetools.api.models.custom_object.CustomObjectDraft customObjectDraft)
Given aCustomObjectDraft
, creates aCustomObjectCompositeIdentifier
using the following fields from the suppliedCustomObjectDraft
:- Parameters:
customObjectDraft
- a composite id is built using its fields.- Returns:
- a composite id comprised of the fields of the supplied
CustomObjectDraft
.
-
of
@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull com.commercetools.api.models.custom_object.CustomObject customObject)
Given aCustomObjectDraft
, creates aCustomObjectCompositeIdentifier
using the following fields from the suppliedCustomObject
:- Parameters:
customObject
- a composite id is built using its fields.- Returns:
- a composite id comprised of the fields of the supplied
CustomObject
.
-
of
@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull java.lang.String key, @Nonnull java.lang.String container)
Given aString
andString
, creates aCustomObjectCompositeIdentifier
using the following fields from the supplied attributes.- Parameters:
key
- key of CustomerObject to build composite Id.container
- container of CustomerObject to build composite Id.- Returns:
- a composite id comprised of the fields of the supplied
key
andcontainer
.
-
of
@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull java.lang.String identifierAsString)
Given aString
with a format "container|key", creates aCustomObjectCompositeIdentifier
using the following fields from the supplied identifier as string.- Parameters:
identifierAsString
- string format of the identifier to build composite Id.- Returns:
- a composite id comprised of the fields of the supplied
key
andcontainer
.
-
getKey
public java.lang.String getKey()
-
getContainer
public java.lang.String getContainer()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-