Package org.polkadot.types.codec
Class Struct
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<java.lang.String,Codec>
-
- org.polkadot.types.codec.Struct
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.String,Codec>,Codec
- Direct Known Subclasses:
AccountInfo,AttestedCandidate,AttestedCandidate.CandidateReceipt,BalanceLock,Block,Calls.MetadataCall,Calls.MetadataCallArg,Calls.OuterDispatchCall,Calls.OuterDispatchMetadata,Digest,Event,EventRecord,Events.EventMetadata,Events.MetadataEvent,Events.OuterEventMetadata,Exposure,Extrinsic,ExtrinsicSignature,Header,Health,IndividualExposure,Justification.RhdJustification,KeyValue,Linkage,MetadataV0,MetadataV1,MetadataV1.MetadataModule,MetadataV2,MetadataV2.MetadataModule,MetadataV3,MetadataV3.MetadataModule,MetadataVersioned,Method,MisbehaviorReport,MisbehaviorReport.BftAtReport,MisbehaviorReport.BftProposeOutOfTurn,Modules.CallMetadata,Modules.FunctionArgumentMetadata,Modules.FunctionMetadata,Modules.MapType,Modules.ModuleMetadata,Modules.RuntimeModuleMetadata,Modules.StorageFunctionMetadata,Modules.StorageMetadata,PeerInfo,PrefabWasmModule,ReferendumInfo,RuntimeVersion,Schedule,SignaturePayload,SignedBlock,StakingLedger,Storage.DoubleMapType,Storage.MapType,Storage.MapType,Storage.MetadataStorageV1,Storage.MetadataStorageV2,Storage.MetadataStorageV3,StorageChangeSet,StoredPendingChange,SubmittableExtrinsic.SubmittableResult,TreasuryProposal,UnlockChunk,ValidatorPrefs,VestingSchedule
public class Struct extends java.util.LinkedHashMap<java.lang.String,Codec> implements Codec
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Struct(Types.ConstructorDef constructorDef, java.lang.Object value)Struct(Types.ConstructorDef constructorDef, java.lang.Object value, java.util.Map<java.lang.String,java.lang.String> json)
-
Method Summary
Modifier and Type Method Description static Types.ConstructorCodec<Struct>builder()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> TgetField(java.lang.String key)booleanisEmpty()Checks if the value is an empty valuejava.util.List<Codec>toArray()Converts the Object to an standard JavaScript Arrayjava.lang.StringtoHex()Returns a hex string representation of the valuejava.lang.ObjecttoJson()Converts the Object to JSON, typically used for RPC transfersjava.lang.StringtoString()byte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specificationsstatic Types.ConstructorCodec<Struct>with(Types.ConstructorDef types)-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Constructor Detail
-
Struct
public Struct(Types.ConstructorDef constructorDef, java.lang.Object value, java.util.Map<java.lang.String,java.lang.String> json)
-
Struct
public Struct(Types.ConstructorDef constructorDef, java.lang.Object value)
-
-
Method Detail
-
with
public static Types.ConstructorCodec<Struct> with(Types.ConstructorDef types)
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec
-
toArray
public java.util.List<Codec> toArray()
Converts the Object to an standard JavaScript Array
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractMap<java.lang.String,Codec>
-
toU8a
public byte[] toU8a(boolean isBare)
Encodes the value as a Uint8Array as per the parity-codec specifications
-
builder
public static Types.ConstructorCodec<Struct> builder()
-
getField
public <T> T getField(java.lang.String key)
-
-