Class Convert

  • All Implemented Interfaces:

    
    public final class Convert<T extends Object>
    
                        

    A utility class Convert to facilitate various conversions including Base64 and Base58BTC.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String toBase64Url(Boolean padding) Converts the value to a Base64Url-encoded string.
      final String toBase64Url() Converts the value to a Base64Url-encoded string.
      final String toBase58Btc() Converts the value to a Base58BTC-encoded string.
      final String toZBase32() Converts the value to a ZBase32-encoded string.
      final String toStr() Converts the value to a string representation.
      final ByteArray toByteArray() Converts the value to a byte array representation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Convert

        Convert(T value, EncodingFormat kind)
        Parameters:
        value - The actual value to be converted.
        kind - Specifies the kind of conversion (optional parameter).
    • Method Detail

      • toBase64Url

        @JvmOverloads() final String toBase64Url(Boolean padding)

        Converts the value to a Base64Url-encoded string.

        Parameters:
        padding - Determines whether the resulting Base64 string should be padded or not.
        Returns:

        The Base64Url-encoded string.

        Note: If the value type is unsupported for this conversion, the method will throw an exception.

      • toBase64Url

        @JvmOverloads() final String toBase64Url()

        Converts the value to a Base64Url-encoded string.

        Returns:

        The Base64Url-encoded string.

        Note: If the value type is unsupported for this conversion, the method will throw an exception.

      • toBase58Btc

         final String toBase58Btc()

        Converts the value to a Base58BTC-encoded string.

        Returns:

        The Base58BTC-encoded string.

        Note: If the value type or kind is unsupported for this conversion, the method will throw an exception.

      • toZBase32

         final String toZBase32()

        Converts the value to a ZBase32-encoded string.

        Returns:

        The ZBase32-encoded string.

      • toStr

         final String toStr()

        Converts the value to a string representation.

        Returns:

        The string representation of the value.

        Note: If the value type or kind is unsupported for this conversion, the method will throw an exception.

      • toByteArray

         final ByteArray toByteArray()

        Converts the value to a byte array representation.

        Returns:

        The byte array representation of the value.

        Note: If the value type or kind is unsupported for this conversion, the method will throw an exception.