public class UuidUtil extends Object
Constructor and Description |
---|
UuidUtil() |
Modifier and Type | Method and Description |
---|---|
static UUID |
binToUuid(byte[] pBytes)
Convert a databased optimized byte array back into an UUID.
|
static byte[] |
fromHex(String pHexValue)
This will convert a hexadecimal number from the string
representation to the actual bytes.
|
static UUID |
generateTimeBasedUuid()
This will generate a version 1 time based UUID.
|
static String |
toHex(byte[] pBytes)
This will convert a byte array to hexadecimal represented as a string.
|
static byte[] |
uuidToBin(UUID pUuid)
Convert an UUID into a database optimized byte array.
|
public static byte[] uuidToBin(UUID pUuid)
pUuid
- the UUID to convertpublic static UUID binToUuid(byte[] pBytes)
pBytes
- the byte array to convert into an UUIDIllegalArgumentException
- if the length of the byte array
is not 16 bytespublic static UUID generateTimeBasedUuid()
public static byte[] fromHex(String pHexValue)
pHexValue
- the hexadecimal number as stringpublic static String toHex(byte[] pBytes)
pBytes
- the byte array to convert to hexadecimal© 1998- 2021 Escenic AS