public final class CustomObjectCompositeIdentifier
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getContainer() |
java.lang.String |
getKey() |
int |
hashCode() |
static CustomObjectCompositeIdentifier |
of(io.sphere.sdk.customobjects.CustomObject customObject)
Given a
CustomObjectDraft , creates a CustomObjectCompositeIdentifier using the
following fields from the supplied CustomObject :
key : key of CustomObject.getKey()
container : container of CustomObject.getContainer()
|
static CustomObjectCompositeIdentifier |
of(io.sphere.sdk.customobjects.CustomObjectDraft customObjectDraft)
Given a
CustomObjectDraft , creates a CustomObjectCompositeIdentifier using the
following fields from the supplied CustomObjectDraft :
key : key of CustomObjectDraft.getKey()
container : container of CustomObjectDraft.getContainer()
|
static CustomObjectCompositeIdentifier |
of(java.lang.String identifierAsString)
Given a
String with a format "container|key", creates a CustomObjectCompositeIdentifier using the following fields from the supplied identifier as
string. |
static CustomObjectCompositeIdentifier |
of(java.lang.String key,
java.lang.String container)
Given a
String and String , creates a CustomObjectCompositeIdentifier
using the following fields from the supplied attributes. |
java.lang.String |
toString() |
@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull io.sphere.sdk.customobjects.CustomObjectDraft customObjectDraft)
CustomObjectDraft
, creates a CustomObjectCompositeIdentifier
using the
following fields from the supplied CustomObjectDraft
:
customObjectDraft
- a composite id is built using its fields.CustomObjectDraft
.@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull io.sphere.sdk.customobjects.CustomObject customObject)
CustomObjectDraft
, creates a CustomObjectCompositeIdentifier
using the
following fields from the supplied CustomObject
:
customObject
- a composite id is built using its fields.CustomObject
.@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull java.lang.String key, @Nonnull java.lang.String container)
String
and String
, creates a CustomObjectCompositeIdentifier
using the following fields from the supplied attributes.key
- key of CustomerObject to build composite Id.container
- container of CustomerObject to build composite Id.key
and container
.@Nonnull public static CustomObjectCompositeIdentifier of(@Nonnull java.lang.String identifierAsString)
String
with a format "container|key", creates a CustomObjectCompositeIdentifier
using the following fields from the supplied identifier as
string.identifierAsString
- string format of the identifier to build composite Id.key
and container
.public java.lang.String getKey()
public java.lang.String getContainer()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object