public class Text extends java.lang.Object implements Codec, java.lang.CharSequence
This is a string wrapper, along with the length. It is used both for strings as well as items such as documentation. It simply extends the standard JS String
built-in object, inheriting all methods exposed from String
.
Constructor and Description |
---|
Text(java.lang.Object value) |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
boolean |
eq(java.lang.Object other)
Compares the value of the input to see if there is a match
|
int |
getEncodedLength()
The length of the value when encoded as a Uint8Array
|
boolean |
isEmpty()
Checks if the value is an empty value
|
int |
length()
The length of the value
|
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toHex()
Returns a hex string representation of the value
|
java.lang.Object |
toJson()
Converts the Object to JSON, typically used for RPC transfers
|
java.lang.String |
toString()
Returns the string representation of the value
|
byte[] |
toU8a(boolean isBare)
Encodes the value as a Uint8Array as per the parity-codec specifications
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConstructorCodec, toU8a
public int getEncodedLength()
The length of the value when encoded as a Uint8Array
getEncodedLength
in interface Codec
public boolean isEmpty()
Checks if the value is an empty value
public boolean eq(java.lang.Object other)
Compares the value of the input to see if there is a match
public java.lang.String toHex()
Returns a hex string representation of the value
public java.lang.Object toJson()
Converts the Object to JSON, typically used for RPC transfers
public java.lang.String toString()
Returns the string representation of the value
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public byte[] toU8a(boolean isBare)
Encodes the value as a Uint8Array as per the parity-codec specifications
public int length()
The length of the value
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence