public class GUID extends Object
GUID
class encapsulates a GUID (Globally Unique IDentifier).
GUID instances are immutable.Constructor and Description |
---|
GUID(byte[] guid)
Constructs a GUID with the specified value.
|
GUID(String guid)
Constructs a GUID with the specified value.
|
Modifier and Type | Method and Description |
---|---|
static String |
canonize(String guid)
Canonizes the given GUID string into the canonical format of the form:
"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", with all values presented as
lowercase hex digits.
|
boolean |
equals(Object o)
Returns whether this GUID is identical to the given GUID.
|
int |
hashCode()
Returns a hash code value for the object.
|
byte[] |
toByteArray()
Returns the GUID as a 16-byte array.
|
String |
toString()
Returns a string representation of this object.
|
public GUID(String guid)
guid
- the GUID value as a hex string (with optional canonical dashes)IllegalArgumentException
- if the given string does not
contain a valid GUIDpublic GUID(byte[] guid)
guid
- the GUID valueIllegalArgumentException
- if the given array does not
contain a valid GUIDpublic static String canonize(String guid)
guid
- the GUID valueIllegalArgumentException
- if the given string does not
contain a valid GUIDpublic byte[] toByteArray()
public String toString()
public boolean equals(Object o)
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.