|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.stafney.UID
Immutable unique identifier. Uses JNI to create a universally unique identifier (UUID) or, in the absence of the JNI layer, a locally unique identifier (LUID). LUID's are guaranteed to be uniuqe only within the confines of the VM that created them. To use the JNI layer:
java.lang.RuntimePermission "loadLibrary.natvuuid"
permission enabled:
As of version 1.0 there is a JNI layer for Windows and Linux >= 7.0
NOTE: Fixed, with #getAddr(), a "feature" with 1.4 VM's that
slowed multiple UID generations to a crawl.
| Field Summary | |
static byte |
GUID_BYTE_SIZE
The byte size of a UID |
protected static long |
serialVersionUID
Self manage our serialization version. |
| Method Summary | |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
|
byte[] |
getBytes()
Get the bytes that comprise this UID |
int |
hashCode()
|
boolean |
isDeferred()
Determine if this UID was deferred to the OS for creation. |
boolean |
isUUID()
Determine if this UID is locally unique or universally unique. |
static UID |
newInstance()
Construct a new UID |
java.lang.String |
toString()
The string representation of this UID in the form D45FD2FC-5C6E-11D1-9EC1-00C04FD7081F. |
static UID |
valueOf(byte[] bytes)
Construct a UID from an array of bytes. |
static UID |
valueOf(java.lang.String guidStr)
Construct a UID from a string in the form D45FD2FC-5C6E-11D1-9EC1-00C04FD7081F or {D45FD2FC-5C6E-11D1-9EC1-00C04FD7081F}. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final byte GUID_BYTE_SIZE
protected static final long serialVersionUID
| Method Detail |
public static UID valueOf(byte[] bytes)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
bytes - the byte representation of a UID.
java.lang.NullPointerException - if the UID string is null
IllegalAgrumentException - if the UID string in incorrectly formatted
java.lang.IllegalArgumentException
public static UID valueOf(java.lang.String guidStr)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
guidStr - a string representation of a UID.
java.lang.NullPointerException - if the UID string is null
IllegalAgrumentException - if the UID string in incorrectly formatted
java.lang.IllegalArgumentExceptionpublic static UID newInstance()
public boolean isUUID()
public boolean isDeferred()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic byte[] getBytes()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||