Package com.saperion.common.lang.id
Class Guid
java.lang.Object
com.saperion.common.lang.id.Guid
- All Implemented Interfaces:
Id
,Serializable
A globally unique identifier, as an implementation of a RFC4122 type 4 UUID.
An instance of Guid
can be used in several threads concurrently.
- Author:
- agz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
final String
Returns the string-representation of thisId
.final String
Returns a 32 byte representation of thisGuid
, that is analogous to the standard 36 byte representation but without the separating "-"-characters.final String
Returns the standard 36 byte representation of thisGuid
.int
hashCode()
protected Object
toString()
-
Constructor Details
-
Guid
public Guid()Creates a newGuid
, representing an already initialized, valid globally unique id-value. -
Guid
Creates a newGuid
, initialized with the id-value represented by the specified string. The specified string may be the standard 36 bytes representation or a reduced 32 bytes representation where the separating "-"-characters are omitted. For letter-characters both upper and lower case is accepted. The specified string must not benull
.- Parameters:
string
- string representation of a guid- See Also:
-
-
Method Details
-
readResolve
-
getString
Returns the string-representation of thisId
. Returns the standard 36 bytes representation of thisGuid
. -
getString32
Returns a 32 byte representation of thisGuid
, that is analogous to the standard 36 byte representation but without the separating "-"-characters. Letters are in upper case always.- Returns:
- 32 byte representation of this
Guid
- See Also:
-
getString36
Returns the standard 36 byte representation of thisGuid
. Letters are in upper case always.- Returns:
- 36 byte standard representation of this
Guid
- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-