public class UniqueIdentifier
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but different external IDs, it would indicate a problem with handling of IDs.
Modifier and Type | Class and Description |
---|---|
static class |
UniqueIdentifier.Companion |
Modifier and Type | Field and Description |
---|---|
static UniqueIdentifier.Companion |
Companion |
Constructor and Description |
---|
UniqueIdentifier(java.lang.String externalId,
java.util.UUID id)
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing
external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but
different external IDs, it would indicate a problem with handling of IDs.
|
UniqueIdentifier()
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing
external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but
different external IDs, it would indicate a problem with handling of IDs.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(UniqueIdentifier other) |
java.lang.String |
component1() |
java.util.UUID |
component2() |
UniqueIdentifier |
copy(java.lang.String externalId,
java.util.UUID id)
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing
external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but
different external IDs, it would indicate a problem with handling of IDs.
|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getExternalId() |
java.util.UUID |
getId() |
int |
hashCode() |
java.lang.String |
toString() |
public static UniqueIdentifier.Companion Companion
public UniqueIdentifier(java.lang.String externalId, java.util.UUID id)
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but different external IDs, it would indicate a problem with handling of IDs.
externalId
- Any existing weak identifier such as trade reference ID.
This should be set here the first time a class UniqueIdentifier
is created as part of state issuance,
or ledger on-boarding activity. This ensure that the human readable identity is paired with the strong ID.id
- Should never be set by user code and left as default initialised.
So that the first time a state is issued this should be given a new UUID.
Subsequent copies and evolutions of a state should just copy the externalId and id fields unmodified.public UniqueIdentifier()
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but different external IDs, it would indicate a problem with handling of IDs.
public java.lang.String toString()
public int compareTo(UniqueIdentifier other)
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String getExternalId()
public java.util.UUID getId()
public java.lang.String component1()
public java.util.UUID component2()
public UniqueIdentifier copy(java.lang.String externalId, java.util.UUID id)
This class provides a truly unique identifier of a trade, state, or other business object, bound to any existing external ID. Equality and comparison are based on the unique ID only; if two states somehow have the same UUID but different external IDs, it would indicate a problem with handling of IDs.
externalId
- Any existing weak identifier such as trade reference ID.
This should be set here the first time a class UniqueIdentifier
is created as part of state issuance,
or ledger on-boarding activity. This ensure that the human readable identity is paired with the strong ID.id
- Should never be set by user code and left as default initialised.
So that the first time a state is issued this should be given a new UUID.
Subsequent copies and evolutions of a state should just copy the externalId and id fields unmodified.