|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.elasticsearch.common.UUID
public class UUID
A UUID taken from java UUID that simply holds less data.
Constructor Summary | |
---|---|
UUID(long mostSigBits,
long leastSigBits)
Constructs a new UUID using the specified data. |
Method Summary | |
---|---|
int |
compareTo(UUID val)
Compares this UUID with the specified UUID. |
boolean |
equals(java.lang.Object obj)
Compares this object to the specified object. |
static UUID |
fromString(java.lang.String name)
Creates a UUID from the string standard representation as described in the toString() method. |
long |
getLeastSignificantBits()
Returns the least significant 64 bits of this UUID's 128 bit value. |
long |
getMostSignificantBits()
Returns the most significant 64 bits of this UUID's 128 bit value. |
int |
hashCode()
Returns a hash code for this UUID . |
static UUID |
nameUUIDFromBytes(byte[] name)
Static factory to retrieve a type 3 (name based) UUID based on the specified byte array. |
static UUID |
randomUUID()
Static factory to retrieve a type 4 (pseudo randomly generated) UUID. |
java.lang.String |
toString()
Returns a String object representing this
UUID . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UUID(long mostSigBits, long leastSigBits)
mostSigBits
- leastSigBits
- Method Detail |
---|
public static UUID randomUUID()
UUID
is generated using a cryptographically strong
pseudo random number generator.
public static UUID nameUUIDFromBytes(byte[] name)
name
- a byte array to be used to construct a UUID.
public static UUID fromString(java.lang.String name)
toString()
method.
name
- a string that specifies a UUID.
java.lang.IllegalArgumentException
- if name does not conform to the
string representation as described in toString()
.public long getLeastSignificantBits()
public long getMostSignificantBits()
public java.lang.String toString()
String
object representing this
UUID
.
The UUID string representation is as described by this BNF :
UUID = <time_low> "-" <time_mid> "-" <time_high_and_version> "-" <variant_and_sequence> "-" <node> time_low = 4*<hexOctet> time_mid = 2*<hexOctet> time_high_and_version = 2*<hexOctet> variant_and_sequence = 2*<hexOctet> node = 6*<hexOctet> hexOctet = <hexDigit><hexDigit> hexDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F"
toString
in class java.lang.Object
public int hashCode()
UUID
.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare with.
true
if the objects are the same;
false
otherwise.public int compareTo(UUID val)
The first of two UUIDs follows the second if the most significant field in which the UUIDs differ is greater for the first UUID.
compareTo
in interface java.lang.Comparable<UUID>
val
- UUID to which this UUID is to be compared.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |