Package com.github.f4b6a3.uuid.util
Class UuidConverter
- java.lang.Object
-
- com.github.f4b6a3.uuid.util.UuidConverter
-
@Deprecated public final class UuidConverter extends Object
Deprecated.use the classes in the codec package instead.Utility that converts UUIDs to and from strings, byte arrays or other UUID types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static UUIDfromBytes(byte[] bytes)Deprecated.useBinaryCodecinstead.static UUIDfromString(String string)Deprecated.useStringCodecinstead.static UUIDtoAndFromMsGuid(UUID uuid)Deprecated.useDotNetGuid4Codecinstead.static byte[]toBytes(UUID uuid)Deprecated.useBinaryCodecinstead.static StringtoString(UUID uuid)Deprecated.useStringCodecinstead.static UUIDtoTimeBasedUuid(UUID uuid)Deprecated.useTimeOrderedCodecinstead.static UUIDtoTimeOrderedUuid(UUID uuid)Deprecated.useTimeOrderedCodecinstead.
-
-
-
Method Detail
-
toBytes
@Deprecated public static byte[] toBytes(UUID uuid)
Deprecated.useBinaryCodecinstead.Get the array of bytes from a UUID.- Parameters:
uuid- a UUID- Returns:
- an array of bytes
-
fromBytes
@Deprecated public static UUID fromBytes(byte[] bytes)
Deprecated.useBinaryCodecinstead.Get a UUID from an array of bytes.- Parameters:
bytes- an array of bytes- Returns:
- a UUID
- Throws:
InvalidUuidException- if invalid
-
toString
@Deprecated public static String toString(UUID uuid)
Deprecated.useStringCodecinstead.Get a string from a UUID. It is much faster thanUUID.toString()in JDK 8. In JDK9+ preferUUID.toString().- Parameters:
uuid- a UUID- Returns:
- a UUID string
-
fromString
@Deprecated public static UUID fromString(String string)
Deprecated.useStringCodecinstead.Get a UUID from a string. It accepts strings: - With URN prefix: "urn:uuid:"; - With curly braces: '{' and '}'; - With upper or lower case; - With or without hyphens. It is much faster thanUUID.fromString(String)in JDK 8.- Parameters:
string- a UUID string- Returns:
- a UUID
- Throws:
InvalidUuidException- if invalid
-
toTimeBasedUuid
@Deprecated public static UUID toTimeBasedUuid(UUID uuid)
Deprecated.useTimeOrderedCodecinstead.Convert a time-ordered UUID to a time-based UUID.- Parameters:
uuid- a UUID- Returns:
- another UUID
- Throws:
IllegalArgumentException- if the input is not a time-ordered UUID
-
toTimeOrderedUuid
@Deprecated public static UUID toTimeOrderedUuid(UUID uuid)
Deprecated.useTimeOrderedCodecinstead.Convert a time-based UUID to a time-ordered UUID.- Parameters:
uuid- a UUID- Returns:
- another UUID
- Throws:
IllegalArgumentException- if the input is not a time-based UUID
-
toAndFromMsGuid
@Deprecated public static UUID toAndFromMsGuid(UUID uuid)
Deprecated.useDotNetGuid4Codecinstead.Convert a random-based UUID (v4) to and from a MS GUID. This method is only useful for MS SQL Server. It rearranges the most significant bytes from big-endian to little-endian, and vice-versa. The Microsoft GUID format stores the most significant bytes as little-endian, while the least significant bytes are stored as big-endian (network order).- Parameters:
uuid- a UUID- Returns:
- another UUID
-
-