public class GUID
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EMPTY_GUID
Default empty GUID
String value. |
Constructor and Description |
---|
GUID(byte[] guidBytes)
Constructor for GUID class.
|
GUID(java.lang.String guidString)
Constructor for GUID class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Overrides the protected
Object.clone() in order to implement the
Cloneable interface. |
static GUID |
createGUID()
Static method to create a new instance of a GUID and auto-generate
its internal value.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static boolean |
isValidGuidString(java.lang.String guidString)
Helper method to determine if a given string is a valid
GUID string.
|
java.lang.String |
toString()
Returns GUID value as a String in the format "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
where each 'x' character is a hexidecimal digit ([0-9A-F]).
|
public static final java.lang.String EMPTY_GUID
String
value.public GUID(java.lang.String guidString)
guidString
- a String of the format "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
where each 'x' character is a hexidecimal digit ([0-9a-fA-F]).
If null
or an empty string, then the GUID will
be initialized to the EMPTY_GUID constant value.public GUID(byte[] guidBytes)
guidBytes
- byte[]
of GUID data.public static GUID createGUID()
public java.lang.Object clone()
Object.clone()
in order to implement the
Cloneable
interface.clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
String
value.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static boolean isValidGuidString(java.lang.String guidString)
guidString
- String
to validate.true
if is a valid GUID string;
false
otherwise.© Copyright IBM Corp. 2006, 2013. All Rights Reserved.