Class 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 Detail

      • toBytes

        @Deprecated
        public static byte[] toBytes​(UUID uuid)
        Deprecated.
        use BinaryCodec instead.
        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.
        use BinaryCodec instead.
        Get a UUID from an array of bytes.
        Parameters:
        bytes - an array of bytes
        Returns:
        a UUID
        Throws:
        InvalidUuidException - if invalid
      • fromString

        @Deprecated
        public static UUID fromString​(String string)
        Deprecated.
        use StringCodec instead.
        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 than UUID.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.
        use TimeOrderedCodec instead.
        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.
        use TimeOrderedCodec instead.
        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.
        use DotNetGuid4Codec instead.
        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