Package org.polkadot.types.codec
Class Tuple
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.polkadot.types.codec.AbstractArray<Codec>
-
- org.polkadot.types.codec.Tuple
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<Codec>,java.util.Collection<Codec>,java.util.List<Codec>,java.util.RandomAccess,Codec
- Direct Known Subclasses:
AttestedCandidate.AvailabilityVote,AttestedCandidate.BalanceUpload,AttestedCandidate.EgressQueueRoot,AttestedCandidate.ValidityVote,BftAuthoritySignature,BftAuthoritySignature.BftHashSignature,Digest.Consensus,Digest.Seal,Event.EventData,Events.OuterEventMetadataEvent,InherentOfflineReport,KeyValue.KeyValueOption,Linkage.LinkageResult,RuntimeVersion.RuntimeVersionApi,StoredPendingChange.NextAuthority
public class Tuple extends AbstractArray<Codec>
A Tuple defines an anonymous fixed-length array, where each element has its own type. It extends the base JS `Array` object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Tuple(Types.ConstructorDef types, java.lang.Object value)
-
Method Summary
Modifier and Type Method Description intgetEncodedLength()The length of the value when encoded as a Uint8Arrayjava.util.List<java.lang.String>getTypes()The types definition of the tuplejava.lang.StringtoString()Returns the string representation of the valuebyte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specifications-
Methods inherited from class org.polkadot.types.codec.AbstractArray
eq, getFiled, isEmpty, length, toHex, toJson
-
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
-
-
-
-
Constructor Detail
-
Tuple
public Tuple(Types.ConstructorDef types, java.lang.Object value)
-
-
Method Detail
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec- Overrides:
getEncodedLengthin classAbstractArray<Codec>
-
getTypes
public java.util.List<java.lang.String> getTypes()
The types definition of the tuple
-
toString
public java.lang.String toString()
Returns the string representation of the value- Overrides:
toStringin classjava.util.AbstractCollection<Codec>
-
toU8a
public byte[] toU8a(boolean isBare)
Description copied from class:AbstractArrayEncodes the value as a Uint8Array as per the parity-codec specifications- Specified by:
toU8ain interfaceCodec- Overrides:
toU8ain classAbstractArray<Codec>- Parameters:
isBare- true when the value has none of the type-specific prefixes (internal) Encodes the value as a Uint8Array as per the parity-codec specifications
-
-