Package net.glowstone.util
Class UuidUtils
java.lang.Object
net.glowstone.util.UuidUtils
Utility methods for dealing with UUIDs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic UUIDfromFlatString(String str) Parses a UUID from a hexadecimal string without hyphens.static UUIDfromIntArray(int[] arr) Parses a UUID from an Int-Array representation.static UUIDfromString(String str) Parses a UUID from a hexadecimal string with hyphens.static StringtoFlatString(UUID uuid) Converts a UUID to a hexadecimal string without hyphens.static int[]toIntArray(UUID uuid) Convert a UUID to its Int-Array representation.static StringConverts a UUID to a hexadecimal string with hyphens.
-
Method Details
-
fromString
Parses a UUID from a hexadecimal string with hyphens.- Parameters:
str- a hexadecimal string- Returns:
stras a UUID
-
fromFlatString
Parses a UUID from a hexadecimal string without hyphens.- Parameters:
str- a 32-digit hexadecimal string- Returns:
stras a UUID
-
toString
Converts a UUID to a hexadecimal string with hyphens.This method uses the FastUUID library for faster serialization in Java 8.
- Parameters:
uuid- a UUID- Returns:
uuidas a hexadecimal string- See Also:
-
FastUUID.toString(UUID)
-
toFlatString
Converts a UUID to a hexadecimal string without hyphens.This method uses the FastUUID library for faster serialization in Java 8.
- Parameters:
uuid- a UUID- Returns:
uuidas a hexadecimal string without hyphens- See Also:
-
FastUUID.toString(UUID)
-
toIntArray
Convert a UUID to its Int-Array representation.- Parameters:
uuid- a UUID- Returns:
- the Int-Array representation of the UUID
-
fromIntArray
Parses a UUID from an Int-Array representation.- Parameters:
arr- the int array containint the representation- Returns:
- a UUID
-