Interface TupleBindingPlugin
- All Known Implementing Classes:
Settlement
public interface TupleBindingPlugin
Plugin interface for tuple/struct bindings used by the array binding profile.
Implementations are discovered via ServiceLoader. Each plugin is responsible
for exactly one ABI tuple element type, e.g. "tuple(uint256,int256)".
The EvmXmlRenderer will:
- parse the element type from the evmstate:call output (e.g. "tuple(uint256,int256)")
- look up a plugin by that string
- build a StructType using the provided struct class
- Author:
- Christian Fries
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends org.web3j.abi.datatypes.StructType> Struct class for that tuple element type.ABI tuple element type string, e.g.
-
Method Details
-
getTupleElementType
String getTupleElementType()ABI tuple element type string, e.g. "tuple(uint256,int256)".MUST exactly match the element type in the evmstate:call output type, e.g. for "settlementHistory()(tuple(uint256,int256)[])" this method must return "tuple(uint256,int256)".
- Returns:
- The string of the tuple binding (to be matched in the XML bindings)
-
getStructClass
Class<? extends org.web3j.abi.datatypes.StructType> getStructClass()Struct class for that tuple element type. Must extend StaticStruct or DynamicStruct and StructType, with a constructor that matches the component types. For example, for "tuple(uint256,int256)" this could be: public static class SettlementStruct extends StaticStruct { public SettlementStruct(Uint256 time, Int256 value) { super(time, value); } }- Returns:
- The Java class representation of the tuple binding (to be used in Web3J)
-