Package com.klaytn.caver.abi
Class FunctionReturnDecoder
- java.lang.Object
-
- com.klaytn.caver.abi.FunctionReturnDecoder
-
- Direct Known Subclasses:
DefaultFunctionReturnDecoder
public abstract class FunctionReturnDecoder extends java.lang.Object
Decodes values returned by function or event calls.Delegates to
DefaultFunctionReturnDecoder
unless aFunctionReturnDecoderProvider
SPI is found, in which case the first implementation found will be used.
-
-
Constructor Summary
Constructors Constructor Description FunctionReturnDecoder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.util.List<Type>
decode(java.lang.String rawInput, java.util.List<TypeReference<Type>> outputParameters)
Decode ABI encoded return values from smart contract function call.protected abstract <T extends Type>
TypedecodeEventParameter(java.lang.String rawInput, TypeReference<T> typeReference)
protected abstract java.util.List<Type>
decodeFunctionResult(java.lang.String rawInput, java.util.List<TypeReference<Type>> outputParameters)
static <T extends Type>
TypedecodeIndexedValue(java.lang.String rawInput, TypeReference<T> typeReference)
Decodes an indexed parameter associated with an event.
-
-
-
Method Detail
-
decode
public static java.util.List<Type> decode(java.lang.String rawInput, java.util.List<TypeReference<Type>> outputParameters)
Decode ABI encoded return values from smart contract function call.- Parameters:
rawInput
- ABI encoded inputoutputParameters
- list of return types asTypeReference
- Returns:
List
of values returned by function,Collections.emptyList()
if invalid response
-
decodeIndexedValue
public static <T extends Type> Type decodeIndexedValue(java.lang.String rawInput, TypeReference<T> typeReference)
Decodes an indexed parameter associated with an event. Indexed parameters are individually encoded, unlike non-indexed parameters which are encoded as per ABI-encoded function parameters and return values.If any of the following types are indexed, the Keccak-256 hashes of the values are returned instead. These are returned as a bytes32 value.
- Arrays
- Strings
- Bytes
See the Solidity documentation for further information.
- Type Parameters:
T
- type of TypeReference- Parameters:
rawInput
- ABI encoded inputtypeReference
- of expected result type- Returns:
- the decode value
-
decodeFunctionResult
protected abstract java.util.List<Type> decodeFunctionResult(java.lang.String rawInput, java.util.List<TypeReference<Type>> outputParameters)
-
decodeEventParameter
protected abstract <T extends Type> Type decodeEventParameter(java.lang.String rawInput, TypeReference<T> typeReference)
-
-