public final class UUIDTools
extends java.lang.Object
UUID.| Modifier and Type | Class and Description |
|---|---|
protected static class |
UUIDTools.UUIDComparator
A UUID comparator comparing UUIDs unsigned, that is a leading 7 is less
than a leading 8.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FORBIDDEN_LONG
The constant value that must not occur as part of a created UUID.
|
static java.util.UUID |
NON_EXISTING_UUID
The UUID that will never exist, created with the
FORBIDDEN_LONG as most and least sig
bits. |
| Modifier and Type | Method and Description |
|---|---|
static java.util.UUID |
createNegativeRandomUUID()
Creates a random UUID which has a negative sign, that means a special bit
for distinguishing two complementary cases.
|
static java.util.UUID |
createNegativeRandomUUIDDebug()
Creates a consecutive UUID having a negative sign.
|
static java.util.UUID |
createPositiveUUID()
Creates a random UUID which has a positive sign, that means a special bit
for distinguishing two complementary cases.
|
static java.util.UUID |
createPositiveUUIDDebug()
Creates a consecutive UUID having a positive sign.
|
static java.util.UUID |
createRandomUUID()
Creates a simple random UUID with no part of it being
FORBIDDEN_LONG. |
static java.util.UUID |
createRandomUUIDDebug()
Creates a consecutive UUID.
|
static SerialisableComparator<java.util.UUID> |
getUnsignedComparator()
Gets a new UUID comparator comparing UUIDs unsigned, that is a leading 7 is
less than a leading 8.
|
static boolean |
isNegative(java.util.UUID uuid)
Returns whether the designated UUID is "negative", that is, it
has a negative sign (the most significant bits are a negative long value).
|
public static final int FORBIDDEN_LONG
public static final java.util.UUID NON_EXISTING_UUID
FORBIDDEN_LONG as most and least sig
bits.public static java.util.UUID createRandomUUID()
FORBIDDEN_LONG.FORBIDDEN_LONG.UUID.randomUUID()public static java.util.UUID createRandomUUIDDebug()
createRandomUUID()public static java.util.UUID createPositiveUUID()
public static java.util.UUID createPositiveUUIDDebug()
createPositiveUUID()public static java.util.UUID createNegativeRandomUUID()
public static java.util.UUID createNegativeRandomUUIDDebug()
createNegativeRandomUUID()public static boolean isNegative(java.util.UUID uuid)
uuid - The UUID to check whether it is negative.public static SerialisableComparator<java.util.UUID> getUnsignedComparator()