public class UUIDUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BYTE_OFFSET_CLOCK_HI |
static int |
BYTE_OFFSET_CLOCK_LO |
static int |
BYTE_OFFSET_CLOCK_MID |
static int |
BYTE_OFFSET_CLOCK_SEQUENCE |
static int |
BYTE_OFFSET_TYPE |
static int |
BYTE_OFFSET_VARIATION |
Constructor and Description |
---|
UUIDUtil() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
asByteArray(UUID uuid) |
static UUID |
constructUUID(UUIDType type,
byte[] uuidBytes)
Helper method for constructing UUID instances with appropriate type
|
static UUID |
constructUUID(UUIDType type,
long l1,
long l2) |
protected static long |
gatherLong(byte[] buffer,
int offset) |
static long |
initUUIDFirstLong(long l1,
int rawType) |
static long |
initUUIDFirstLong(long l1,
UUIDType type) |
static long |
initUUIDSecondLong(long l2) |
static UUID |
maxUUID()
Accessor for so-call "Max UUID" (see
UUID 6 draft;
one that is all one bits
|
static UUID |
nilUUID()
Accessor for so-call "Nil UUID" (see
RFC 4122/4.1.7;
one that is all zeroes.
|
static void |
toByteArray(UUID uuid,
byte[] buffer) |
static void |
toByteArray(UUID uuid,
byte[] buffer,
int offset) |
static UUIDType |
typeOf(UUID uuid)
Method for determining which type of UUID given UUID is.
|
static UUID |
uuid(byte[] bytes)
Factory method for constructing
UUID instance from given
16 bytes. |
static UUID |
uuid(byte[] bytes,
int offset)
Factory method for constructing
UUID instance from given
16 bytes. |
static UUID |
uuid(String id)
Factory method for creating UUIDs from the canonical string
representation.
|
public static final int BYTE_OFFSET_CLOCK_LO
public static final int BYTE_OFFSET_CLOCK_MID
public static final int BYTE_OFFSET_CLOCK_HI
public static final int BYTE_OFFSET_TYPE
public static final int BYTE_OFFSET_CLOCK_SEQUENCE
public static final int BYTE_OFFSET_VARIATION
public static UUID nilUUID()
public static UUID maxUUID()
public static UUID uuid(String id)
id
- String that contains the canonical representation of
the UUID to build; 36-char string (see UUID specs for details).
Hex-chars may be in upper-case too; UUID class will always output
them in lowercase.public static UUID uuid(byte[] bytes)
UUID
instance from given
16 bytes.
NOTE: since absolutely no validation is done for contents, this method should
only be used if contents are known to be valid.public static UUID uuid(byte[] bytes, int offset)
UUID
instance from given
16 bytes.
NOTE: since absolutely no validation is done for contents, this method should
only be used if contents are known to be valid.bytes
- Array that contains sequence of 16 bytes that contain a valid UUIDoffset
- Offset of the first of 16 bytespublic static UUID constructUUID(UUIDType type, byte[] uuidBytes)
public static long initUUIDFirstLong(long l1, UUIDType type)
public static long initUUIDFirstLong(long l1, int rawType)
public static long initUUIDSecondLong(long l2)
public static UUIDType typeOf(UUID uuid)
uuid
- UUID to checkpublic static byte[] asByteArray(UUID uuid)
public static void toByteArray(UUID uuid, byte[] buffer)
public static void toByteArray(UUID uuid, byte[] buffer, int offset)
protected static final long gatherLong(byte[] buffer, int offset)
Copyright © 2023 FasterXML.com. All rights reserved.