public class UUID extends Object implements Serializable
This class represents a universally unique identifier, consisting of two long integral values.
This identifier is supposed to be unique both spatially and temporally. It is based on version 4 IETF variant random UUIDs.
Modifier and Type | Field and Description |
---|---|
static int |
FQ_LENGTH |
static String |
PROTOCOL |
static String |
PROTOCOL_UCASE |
Constructor and Description |
---|
UUID(long mostSig,
long leastSig)
Construct an instance of this class from two long integral values.
|
UUID(UUID uuid) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object obj)
Compares this object to another.
|
boolean |
equals(Object obj)
Returns true if the specified object is semantically equal to this
instance.
|
String |
exportableForm()
Returns a 36-character string of six fields separated by hyphens,
with each field represented in lowercase hexadecimal with the same
number of digits as in the field.
|
String |
getProtocol()
Return the name of the protocol that this factory uses.
|
int |
hashCode()
Returns the hashcode for this instance.
|
static void |
main(String[] args) |
String |
toString()
Returns a string representing the current state of the object.
|
String |
toString(char delim) |
public static final String PROTOCOL
public static final String PROTOCOL_UCASE
public static final int FQ_LENGTH
public UUID(long mostSig, long leastSig)
IllegalArgumentException
- if either value is negativepublic UUID(UUID uuid)
public String getProtocol()
public int hashCode()
public boolean equals(Object obj)
Returns true if the specified object is semantically equal to this
instance. Note: this method is consistent with compareTo()
.
UUID instances are equal if they represent the same 128-bit value.
public int compareTo(Object obj)
Compares this object to another. If the specified object is not an instance of the LongID class, then this method throws a ClassCastException (as instances are comparable only to instances of the same class).
Note: this method is consistent with equals()
,
meaning that (compare(x, y)==0) == (x.equals(y))
.
obj
- the object that this instance is to be compared to; may not be null.ClassCastException
- if the specified object's type prevents it
from being compared to this instance.public String toString()
public String toString(char delim)
org.teiid.core.id.ObjectID#toString(char)
public String exportableForm()
Returns a 36-character string of six fields separated by hyphens, with each field represented in lowercase hexadecimal with the same number of digits as in the field. The order of fields is: time_low, time_mid, version and time_hi treated as a single field, variant and clock_seq treated as a single field, and node.
public static void main(String[] args)
Copyright © 2018 JBoss by Red Hat. All rights reserved.