Package org.polkadot.types.type
Class Address
- java.lang.Object
-
- org.polkadot.types.codec.Base<Codec>
-
- org.polkadot.types.type.Address
-
- All Implemented Interfaces:
Codec
public class Address extends Base<Codec> implements Codec
A wrapper around an AccountId and/or AccountIndex that is encoded with a prefix. Since we are dealing with underlying publicKeys (or shorter encoded addresses), we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address is encoded as `[, ...publicKey/...bytes ]` as per spec
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]ACCOUNT_ID_PREFIX
-
Constructor Summary
Constructors Constructor Description Address(java.lang.Object value)
-
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 Uint8ArrayintgetRawLength()The length of the raw value, either AccountIndex or AccountIdbooleanisEmpty()Checks if the value is an empty valuejava.lang.StringtoHex()Returns a hex string representation of the valuejava.lang.ObjecttoJson()Converts the Object to JSON, typically used for RPC transfersjava.lang.StringtoString()Returns the string representation of the valuebyte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specifications
-
-
-
Method Detail
-
getRawLength
public int getRawLength()
The length of the raw value, either AccountIndex or AccountId
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec
-
isEmpty
public boolean isEmpty()
Checks if the value is an empty value
-
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()
Returns the string representation of the value- Overrides:
toStringin classjava.lang.Object
-
-