Package com.saperion.common.lang.id
Class Guid
- java.lang.Object
-
- com.saperion.common.lang.id.Guid
-
- All Implemented Interfaces:
Id,java.io.Serializable
public class Guid extends java.lang.Object implements Id
A globally unique identifier, as an implementation of a RFC4122 type 4 UUID.
An instance of
Guidcan be used in several threads concurrently.- Author:
- agz
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetString()Returns the string-representation of thisId.java.lang.StringgetString32()Returns a 32 byte representation of thisGuid, that is analogous to the standard 36 byte representation but without the separating "-"-characters.java.lang.StringgetString36()Returns the standard 36 byte representation of thisGuid.inthashCode()protected java.lang.ObjectreadResolve()java.lang.StringtoString()
-
-
-
Constructor Detail
-
Guid
public Guid()
Creates a newGuid, representing an already initialized, valid globally unique id-value.
-
Guid
public Guid(java.lang.String string)
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:
getString()
-
-
Method Detail
-
readResolve
protected java.lang.Object readResolve()
-
getString
public final java.lang.String getString()
Returns the string-representation of thisId. Returns the standard 36 bytes representation of thisGuid.- Specified by:
getStringin interfaceId- Returns:
- the string-representation of this
Id - See Also:
getString36(),getString32(),Guid(String)
-
getString32
public final java.lang.String 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(),Guid(String)
-
getString36
public final java.lang.String 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:
getString32(),Guid(String)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-