public class StringLiteralHelper
extends java.lang.Object
The conversion from string to the resulting type is made at compile time.
| Constructor and Description |
|---|
StringLiteralHelper() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
addressToScriptHash(java.lang.String address)
Converts the given Neo address to the corresponding script hash as a little-endian byte
array.
|
static byte[] |
hexToBytes(java.lang.String hex)
Converts the given hex string to a byte array.
|
static int |
stringToInt(java.lang.String text)
Converts the given number string to an integer.
|
public static byte[] addressToScriptHash(java.lang.String address)
This method can only be applied to constant string literals.
Example: addressToScriptHash("AFsCjUGzicZmXQtWpwVt6hNeJTBwSipJMS") generates 0102030405060708090a0b0c0d0e0faabbccddee
address - The address to convert to script hash.public static byte[] hexToBytes(java.lang.String hex)
This method can only be applied to constant string literals.
Example: hexToBytes("0102030405060708090a0b0c0d0e0faabbccddee") generates the corresponding byte array.
hex - The hex string to convert to bytes.public static int stringToInt(java.lang.String text)
This method can only be applied to constant string literals.
Example: stringToInt("10000") generates the int with the value 10000.
text - The string representation of the integer.