public class Uuid extends Object implements Comparable<Uuid>
Modifier and Type | Field and Description |
---|---|
static Uuid |
ZERO_UUID
A UUID that represents a null or empty UUID.
|
Constructor and Description |
---|
Uuid(long mostSigBits,
long leastSigBits)
Constructs a 128-bit type 4 UUID where the first long represents the the most significant 64 bits
and the second long represents the least significant 64 bits.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Uuid other) |
boolean |
equals(Object obj)
Returns true iff obj is another Uuid represented by the same two long values.
|
static Uuid |
fromString(String str)
Creates a UUID based on a base64 string encoding used in the toString() method.
|
long |
getLeastSignificantBits()
Returns the least significant bits of the UUID's 128 value.
|
long |
getMostSignificantBits()
Returns the most significant bits of the UUID's 128 value.
|
int |
hashCode()
Returns a hash code for this UUID
|
static Uuid |
randomUuid()
Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
|
String |
toString()
Returns a base64 string encoding of the UUID.
|
public static final Uuid ZERO_UUID
public Uuid(long mostSigBits, long leastSigBits)
public static Uuid randomUuid()
public long getMostSignificantBits()
public long getLeastSignificantBits()
public boolean equals(Object obj)
public int hashCode()
public String toString()
public static Uuid fromString(String str)
public int compareTo(Uuid other)
compareTo
in interface Comparable<Uuid>