Class EnumType<T>

    • Field Summary

      • Fields inherited from class org.polkadot.types.codec.Base

        raw
    • Constructor Summary

      Constructors 
      Constructor Description
      EnumType​(Types.ConstructorDef def, java.lang.Object value, int index, java.util.LinkedHashMap<java.lang.String,​java.lang.String> aliasses)  
    • Method Summary

      Modifier and Type Method Description
      boolean eq​(java.lang.Object other)
      Compares the value of the input to see if there is a match
      int getEncodedLength()
      The length of the value when encoded as a Uint8Array
      java.lang.String getType()
      The name of the type this enum value represents
      int index()
      The index of the metadata value
      boolean isEmpty()
      Checks if the value is an empty value
      boolean isNone()
      Checks if the Enum points to a Null type
      boolean isNull()
      Checks if the Enum points to a Null type (deprecated, use isNone)
      boolean isType​(java.lang.String value)  
      java.lang.String toHex()
      Returns a hex string representation of the value
      java.lang.Object toJson()
      Converts the Object to JSON, typically used for RPC transfers
      int toNumber()
      Returns the number representation for the value
      java.lang.String toString()
      Returns the string representation of the value
      byte[] toU8a​(boolean isBare)
      Encodes the value as a Uint8Array as per the parity-codec specifications
      Codec value()
      The value of the enum
      static Types.ConstructorCodec<EnumType> with​(Types.ConstructorDef def)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.polkadot.types.Codec

        toU8a
    • Constructor Detail

      • EnumType

        public EnumType​(Types.ConstructorDef def,
                        java.lang.Object value,
                        int index,
                        java.util.LinkedHashMap<java.lang.String,​java.lang.String> aliasses)
    • Method Detail

      • toNumber

        public int toNumber()
        Returns the number representation for the value
      • value

        public Codec value()
        The value of the enum
      • getType

        public java.lang.String getType()
        The name of the type this enum value represents
      • index

        public int index()
        The index of the metadata value
      • isNull

        public boolean isNull()
        Checks if the Enum points to a Null type (deprecated, use isNone)
      • getEncodedLength

        public int getEncodedLength()
        The length of the value when encoded as a Uint8Array
        Specified by:
        getEncodedLength in interface Codec
      • isEmpty

        public boolean isEmpty()
        Checks if the value is an empty value
        Specified by:
        isEmpty in interface Codec
      • isNone

        public boolean isNone()
        Checks if the Enum points to a Null type
      • eq

        public boolean eq​(java.lang.Object other)
        Compares the value of the input to see if there is a match
        Specified by:
        eq in interface Codec
      • toHex

        public java.lang.String toHex()
        Returns a hex string representation of the value
        Specified by:
        toHex in interface Codec
      • toJson

        public java.lang.Object toJson()
        Converts the Object to JSON, typically used for RPC transfers
        Specified by:
        toJson in interface Codec
      • toString

        public java.lang.String toString()
        Returns the string representation of the value
        Overrides:
        toString in class java.lang.Object
      • toU8a

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

        public boolean isType​(java.lang.String value)