|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groupon.uuid.UUID
public final class UUID
See README.md for more information
| Field Summary | |
|---|---|
static byte[] |
MAC
|
static int |
PID
|
| Constructor Summary | |
|---|---|
UUID()
Constructor that generates a new UUID using the current process id, MAC address, and timestamp |
|
UUID(byte[] bytes)
Constructor that takes a byte array as this UUID's content |
|
UUID(String id)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
byte[] |
getBytes()
copy the content of this UUID, so that it can't be changed, and return it |
byte[] |
getMacFragment()
extract MAC address fragment from raw UUID bytes, setting missing values to 0, thus the first 2 and a half bytes will be 0, followed by 3 and a half bytes of the active MAC address when the UUID was generated |
int |
getProcessId()
extract process id from raw UUID bytes and return as int |
Date |
getTimestamp()
extract timestamp from raw UUID bytes and return as int |
char |
getVersion()
extract version field as a hex char from raw UUID bytes |
int |
hashCode()
|
String |
toString()
|
static void |
useSequentialIds()
Toggle uuid generator into sequential mode, so the random segment is in order and increases by one |
static void |
useVariableIds()
Toggle uuid generator into variable mode, so the random segment is in reverse order and increases by a large increment. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PID
public static final byte[] MAC
| Constructor Detail |
|---|
public UUID()
public UUID(byte[] bytes)
bytes - UUID contentpublic UUID(String id)
| Method Detail |
|---|
public static void useSequentialIds()
public static void useVariableIds()
public byte[] getBytes()
public String toString()
toString in class Objectpublic char getVersion()
public int getProcessId()
public Date getTimestamp()
public byte[] getMacFragment()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||