Class Type

  • All Implemented Interfaces:
    java.lang.CharSequence, Codec
    Direct Known Subclasses:
    Modules.PlainType, Storage.PlainType, Storage.PlainType

    public class Type
    extends Text
    This is a extended version of String, specifically to handle types. Here we rely fully on what string provides us, however we also adjust the types received from the runtime, i.e. we remove the `T::` prefixes found in some types for consistency accross implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      Type​(java.lang.Object value)  
    • Method Summary

      Modifier and Type Method Description
      int getEncodedLength()
      The length of the value when encoded as a Uint8Array
      byte[] toU8a​(boolean isBare)
      Encodes the value as a Uint8Array as per the parity-codec specifications
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints
      • Methods inherited from interface org.polkadot.types.Codec

        toU8a
    • Constructor Detail

      • Type

        public Type​(java.lang.Object value)
    • Method Detail

      • getEncodedLength

        public int getEncodedLength()
        Description copied from class: Text
        The length of the value when encoded as a Uint8Array
        Specified by:
        getEncodedLength in interface Codec
        Overrides:
        getEncodedLength in class Text
      • toU8a

        public byte[] toU8a​(boolean isBare)
        Description copied from class: Text
        Encodes the value as a Uint8Array as per the parity-codec specifications
        Specified by:
        toU8a in interface Codec
        Overrides:
        toU8a in class Text
        Parameters:
        isBare - true when the value has none of the type-specific prefixes (internal)