Package org.polkadot.types.codec
Class AbstractArray<T extends Codec>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.polkadot.types.codec.AbstractArray<T>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>,java.util.RandomAccess,Codec
public class AbstractArray<T extends Codec> extends java.util.ArrayList<T> implements Codec
AbstractArray This manages codec arrays. It is an extension to Array, providing specific encoding/decoding on top of the base type.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractArray()
-
Method Summary
Modifier and Type Method Description booleaneq(java.lang.Object other)Compares the value of the input to see if there is a matchintgetEncodedLength()The length of the value when encoded as a Uint8Array<T> TgetFiled(int index)booleanisEmpty()Checks if the value is an empty valueintlength()The length of the valuejava.lang.StringtoHex()Returns a hex string representation of the valuejava.lang.ObjecttoJson()Converts the Object to JSON, typically used for RPC transfersbyte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specifications-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Checks if the value is an empty value
-
length
public int length()
The length of the value
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec
-
eq
public boolean eq(java.lang.Object other)
Compares the value of the input to see if there is a match
-
toHex
public java.lang.String toHex()
Returns a hex string representation of the value
-
toJson
public java.lang.Object toJson()
Converts the Object to JSON, typically used for RPC transfers
-
toU8a
public byte[] toU8a(boolean isBare)
Encodes the value as a Uint8Array as per the parity-codec specifications
-
getFiled
public <T> T getFiled(int index)
- Parameters:
callbackfn- The mapping functionthisArg- The `this` onject to apply the result to Maps the array with the callback
-
-