Package org.polkadot.types.primitive
Class Type
- java.lang.Object
-
- org.polkadot.types.primitive.Text
-
- org.polkadot.types.primitive.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 intgetEncodedLength()The length of the value when encoded as a Uint8Arraybyte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specifications-
Methods inherited from class org.polkadot.types.primitive.Text
charAt, eq, isEmpty, length, subSequence, toHex, toJson, toString
-
-
-
-
Method Detail
-
getEncodedLength
public int getEncodedLength()
Description copied from class:TextThe length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec- Overrides:
getEncodedLengthin classText
-
toU8a
public byte[] toU8a(boolean isBare)
Description copied from class:TextEncodes the value as a Uint8Array as per the parity-codec specifications
-
-