public class Scv
extends java.lang.Object
SCVal
more conveniently.Modifier and Type | Method and Description |
---|---|
static Address |
fromAddress(SCVal scVal)
|
static boolean |
fromBoolean(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_BOOL to boolean. |
static byte[] |
fromBytes(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_BYTES to byte[]. |
static SCContractInstance |
fromContractInstance(SCVal scVal)
|
static java.math.BigInteger |
fromDuration(SCVal scVal)
|
static SCError |
fromError(SCVal scVal)
|
static java.math.BigInteger |
fromInt128(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_I128 to int128. |
static java.math.BigInteger |
fromInt256(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_I256 to int256. |
static int |
fromInt32(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_I128 to int32. |
static long |
fromInt64(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_I64 to int64. |
static void |
fromLedgerKeyContractInstance(SCVal scVal)
Parse from
SCVal with the type of SCValType.SCV_LEDGER_KEY_CONTRACT_INSTANCE ,
this function returns void if conversion succeeds. |
static long |
fromLedgerKeyNonce(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_LEDGER_KEY_NONCE to long. |
static java.util.LinkedHashMap<SCVal,SCVal> |
fromMap(SCVal scVal)
|
static byte[] |
fromString(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_STRING to String. |
static java.lang.String |
fromSymbol(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_SYMBOL to String. |
static java.math.BigInteger |
fromTimePoint(SCVal scVal)
|
static java.math.BigInteger |
fromUint128(SCVal scVal)
|
static java.math.BigInteger |
fromUint256(SCVal scVal)
|
static long |
fromUint32(SCVal scVal)
Convert from
SCVal with the type of SCValType.SCV_U32 to int. |
static java.math.BigInteger |
fromUint64(SCVal scVal)
|
static java.util.Collection<SCVal> |
fromVec(SCVal scVal)
|
static void |
fromVoid(SCVal scVal)
Parse from
SCVal with the type of SCValType.SCV_VOID , this function returns
void if conversion succeeds. |
static SCVal |
toAddress(Address address)
Build a
SCVal with the type of SCValType.SCV_ADDRESS . |
static SCVal |
toAddress(java.lang.String address)
Build a
SCVal with the type of SCValType.SCV_ADDRESS . |
static SCVal |
toBoolean(boolean bool)
Build a
SCVal with the type of SCValType.SCV_BOOL . |
static SCVal |
toBytes(byte[] bytes)
Build a
SCVal with the type of SCValType.SCV_BYTES . |
static SCVal |
toContractInstance(SCContractInstance instance)
Build a
SCVal with the type of SCValType.SCV_CONTRACT_INSTANCE . |
static SCVal |
toDuration(java.math.BigInteger duration)
Build a
SCVal with the type of SCValType.SCV_DURATION . |
static SCVal |
toError(SCError error)
Build a
SCVal with the type of SCValType.SCV_ERROR . |
static SCVal |
toInt128(java.math.BigInteger int128)
Build a
SCVal with the type of SCValType.SCV_I128 . |
static SCVal |
toInt256(java.math.BigInteger int256)
Build a
SCVal with the type of SCValType.SCV_I256 . |
static SCVal |
toInt32(int int32)
Build a
SCVal with the type of SCValType.SCV_I128 . |
static SCVal |
toInt64(long int64)
Build a
SCVal with the type of SCValType.SCV_I64 . |
static SCVal |
toLedgerKeyContractInstance()
Build a
SCVal with the type of SCValType.SCV_LEDGER_KEY_NONCE . |
static SCVal |
toLedgerKeyNonce(long nonce)
Build a
SCVal with the type of SCValType.SCV_LEDGER_KEY_NONCE . |
static SCVal |
toMap(java.util.LinkedHashMap<SCVal,SCVal> map)
Build a
SCVal with the type of SCValType.SCV_MAP . |
static SCVal |
toString(byte[] string)
Build a
SCVal with the type of SCValType.SCV_STRING . |
static SCVal |
toString(java.lang.String string)
Build a
SCVal with the type of SCValType.SCV_STRING . |
static SCVal |
toSymbol(java.lang.String symbol)
Build a
SCVal with the type of SCValType.SCV_SYMBOL . |
static SCVal |
toTimePoint(java.math.BigInteger timePoint)
Build a
SCVal with the type of SCValType.SCV_TIMEPOINT . |
static SCVal |
toUint128(java.math.BigInteger uint128)
Build a
SCVal with the type of SCValType.SCV_U128 . |
static SCVal |
toUint256(java.math.BigInteger uint256)
Build a
SCVal with the type of SCValType.SCV_U256 . |
static SCVal |
toUint32(long uint32)
Build a
SCVal with the type of SCValType.SCV_U32 . |
static SCVal |
toUint64(java.math.BigInteger uint64)
Build a
SCVal with the type of SCValType.SCV_U64 . |
static SCVal |
toVec(java.util.Collection<SCVal> vec)
Build a
SCVal with the type of SCValType.SCV_VEC . |
static SCVal |
toVoid()
Build a
SCVal with the type of SCValType.SCV_VOID . |
public static SCVal toAddress(java.lang.String address)
SCVal
with the type of SCValType.SCV_ADDRESS
.address
- address to convertSCVal
with the type of SCValType.SCV_ADDRESS
public static SCVal toAddress(Address address)
SCVal
with the type of SCValType.SCV_ADDRESS
.address
- address to convertSCVal
with the type of SCValType.SCV_ADDRESS
public static Address fromAddress(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toBoolean(boolean bool)
SCVal
with the type of SCValType.SCV_BOOL
.bool
- boolean to convertSCVal
with the type of SCValType.SCV_BOOL
public static boolean fromBoolean(SCVal scVal)
SCVal
with the type of SCValType.SCV_BOOL
to boolean.scVal
- SCVal
to convertpublic static SCVal toBytes(byte[] bytes)
SCVal
with the type of SCValType.SCV_BYTES
.bytes
- bytes to convertSCVal
with the type of SCValType.SCV_BYTES
public static byte[] fromBytes(SCVal scVal)
SCVal
with the type of SCValType.SCV_BYTES
to byte[].scVal
- SCVal
to convertpublic static SCVal toContractInstance(SCContractInstance instance)
SCVal
with the type of SCValType.SCV_CONTRACT_INSTANCE
.instance
- SCContractInstance
to convertSCVal
with the type of SCValType.SCV_CONTRACT_INSTANCE
public static SCContractInstance fromContractInstance(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toDuration(java.math.BigInteger duration)
SCVal
with the type of SCValType.SCV_DURATION
.duration
- duration to convert (uint64)SCVal
with the type of SCValType.SCV_DURATION
public static java.math.BigInteger fromDuration(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toError(SCError error)
SCVal
with the type of SCValType.SCV_ERROR
.error
- SCError
to convertSCVal
with the type of SCValType.SCV_ERROR
public static SCError fromError(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toInt32(int int32)
SCVal
with the type of SCValType.SCV_I128
.int32
- int32 to convertSCVal
with the type of SCValType.SCV_I128
public static int fromInt32(SCVal scVal)
SCVal
with the type of SCValType.SCV_I128
to int32.scVal
- SCVal
to convertpublic static SCVal toInt64(long int64)
SCVal
with the type of SCValType.SCV_I64
.int64
- int64 to convertSCVal
with the type of SCValType.SCV_I64
public static long fromInt64(SCVal scVal)
SCVal
with the type of SCValType.SCV_I64
to int64.scVal
- SCVal
to convertpublic static SCVal toInt128(java.math.BigInteger int128)
SCVal
with the type of SCValType.SCV_I128
.int128
- int128 to convertSCVal
with the type of SCValType.SCV_I128
public static java.math.BigInteger fromInt128(SCVal scVal)
SCVal
with the type of SCValType.SCV_I128
to int128.scVal
- SCVal
to convertpublic static SCVal toInt256(java.math.BigInteger int256)
SCVal
with the type of SCValType.SCV_I256
.int256
- int256 to convertSCVal
with the type of SCValType.SCV_I256
public static java.math.BigInteger fromInt256(SCVal scVal)
SCVal
with the type of SCValType.SCV_I256
to int256.scVal
- SCVal
to convertpublic static SCVal toLedgerKeyContractInstance()
SCVal
with the type of SCValType.SCV_LEDGER_KEY_NONCE
.SCVal
with the type of SCValType.SCV_LEDGER_KEY_NONCE
public static void fromLedgerKeyContractInstance(SCVal scVal)
SCVal
with the type of SCValType.SCV_LEDGER_KEY_CONTRACT_INSTANCE
,
this function returns void if conversion succeeds.scVal
- SCVal
to convertpublic static SCVal toLedgerKeyNonce(long nonce)
SCVal
with the type of SCValType.SCV_LEDGER_KEY_NONCE
.nonce
- nonce to convertSCVal
with the type of SCValType.SCV_LEDGER_KEY_NONCE
public static long fromLedgerKeyNonce(SCVal scVal)
SCVal
with the type of SCValType.SCV_LEDGER_KEY_NONCE
to long.scVal
- SCVal
to convertpublic static SCVal toMap(java.util.LinkedHashMap<SCVal,SCVal> map)
SCVal
with the type of SCValType.SCV_MAP
.map
- map to convertSCVal
with the type of SCValType.SCV_MAP
public static java.util.LinkedHashMap<SCVal,SCVal> fromMap(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toString(java.lang.String string)
SCVal
with the type of SCValType.SCV_STRING
.string
- string to convertSCVal
with the type of SCValType.SCV_STRING
public static SCVal toString(byte[] string)
SCVal
with the type of SCValType.SCV_STRING
.string
- string to convertSCVal
with the type of SCValType.SCV_STRING
public static byte[] fromString(SCVal scVal)
SCVal
with the type of SCValType.SCV_STRING
to String.scVal
- SCVal
to convertpublic static SCVal toSymbol(java.lang.String symbol)
SCVal
with the type of SCValType.SCV_SYMBOL
.symbol
- symbol to convertSCVal
with the type of SCValType.SCV_SYMBOL
public static java.lang.String fromSymbol(SCVal scVal)
SCVal
with the type of SCValType.SCV_SYMBOL
to String.scVal
- SCVal
to convertpublic static SCVal toTimePoint(java.math.BigInteger timePoint)
SCVal
with the type of SCValType.SCV_TIMEPOINT
.timePoint
- timePoint to convert (uint64)SCVal
with the type of SCValType.SCV_TIMEPOINT
public static java.math.BigInteger fromTimePoint(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toUint32(long uint32)
SCVal
with the type of SCValType.SCV_U32
.uint32
- uint32 to convertSCVal
with the type of SCValType.SCV_U32
public static long fromUint32(SCVal scVal)
SCVal
with the type of SCValType.SCV_U32
to int.scVal
- SCVal
to convertpublic static SCVal toUint64(java.math.BigInteger uint64)
SCVal
with the type of SCValType.SCV_U64
.uint64
- uint64 to convertSCVal
with the type of SCValType.SCV_U64
public static java.math.BigInteger fromUint64(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toUint128(java.math.BigInteger uint128)
SCVal
with the type of SCValType.SCV_U128
.uint128
- uint128 to convertSCVal
with the type of SCValType.SCV_U128
public static java.math.BigInteger fromUint128(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toUint256(java.math.BigInteger uint256)
SCVal
with the type of SCValType.SCV_U256
.uint256
- uint256 to convertSCVal
with the type of SCValType.SCV_U256
public static java.math.BigInteger fromUint256(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toVec(java.util.Collection<SCVal> vec)
SCVal
with the type of SCValType.SCV_VEC
.vec
- vec to convertSCVal
with the type of SCValType.SCV_VEC
public static java.util.Collection<SCVal> fromVec(SCVal scVal)
scVal
- SCVal
to convertpublic static SCVal toVoid()
SCVal
with the type of SCValType.SCV_VOID
.SCVal
with the type of SCValType.SCV_VOID
public static void fromVoid(SCVal scVal)
SCVal
with the type of SCValType.SCV_VOID
, this function returns
void if conversion succeeds.scVal
- SCVal
to convert