java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.ContractAbi
public record ContractAbi(tech.deplant.java4ever.binding.Abi.AbiContract abiContract)
extends Record
Holds entire ABI structure and has helper methods to check functions availability or
getting input types and so on. Use factory methods to create from File or JsonNode.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionContractAbi(tech.deplant.java4ever.binding.Abi.AbiContract abiContract) Creates an instance of aContractAbirecord class. -
Method Summary
Modifier and TypeMethodDescriptiontech.deplant.java4ever.binding.Abi.ABIABI()tech.deplant.java4ever.binding.Abi.AbiContractReturns the value of theabiContractrecord component.convertFunctionInputs(String functionName, Map<String, Object> functionInputs) Checks and converts provided Java Map containing inputs for function call to correct representation that will be accepted by ABI.convertFunctionOutputs(String functionName, Map<String, Object> functionOutputs) Checks and converts provided Java Map containing inputs for function call to correct representation that will be accepted by ABI.convertInitDataInputs(Map<String, Object> initDataInputs) Checks and converts provided Java Map containing inputs for initialData to correct representation that will be accepted by ABI.tech.deplant.java4ever.binding.Abi.AbiData[]data()final booleanIndicates whether some other object is "equal to" this one.tech.deplant.java4ever.binding.Abi.AbiParameventInputType(String functionName, String inputName) tech.deplant.java4ever.binding.Abi.AbiEvent[]events()functionId(Sdk sdk, String name) tech.deplant.java4ever.binding.Abi.AbiParamfunctionInputType(String functionName, String inputName) tech.deplant.java4ever.binding.Abi.AbiParamfunctionOutputType(String functionName, String outputName) tech.deplant.java4ever.binding.Abi.AbiFunction[]booleanhasFunction(String name) final inthashCode()Returns a hash code value for this object.booleanbooleanhasInitDataParam(String initDataName) booleanbooleanString[]header()tech.deplant.java4ever.binding.Abi.AbiParaminitDataType(String initDataName) json()static ContractAbistatic ContractAbiofJsonNode(com.fasterxml.jackson.databind.JsonNode node) static ContractAbiofResource(String resourceName) static ContractAbifinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ContractAbi
public ContractAbi(tech.deplant.java4ever.binding.Abi.AbiContract abiContract) Creates an instance of aContractAbirecord class.- Parameters:
abiContract- the value for theabiContractrecord component
-
-
Method Details
-
ofString
public static ContractAbi ofString(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
ofResource
public static ContractAbi ofResource(String resourceName) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
ofFile
public static ContractAbi ofFile(String filePath) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
ofJsonNode
public static ContractAbi ofJsonNode(com.fasterxml.jackson.databind.JsonNode node) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
json
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
functionId
public String functionId(Sdk sdk, String name) throws tech.deplant.java4ever.binding.EverSdkException - Throws:
tech.deplant.java4ever.binding.EverSdkException
-
hasHeader
-
hasFunction
-
hasInitDataParam
-
hasInput
-
hasOutput
-
functionInputType
-
initDataType
-
functionOutputType
-
eventInputType
-
data
public tech.deplant.java4ever.binding.Abi.AbiData[] data() -
functions
public tech.deplant.java4ever.binding.Abi.AbiFunction[] functions() -
events
public tech.deplant.java4ever.binding.Abi.AbiEvent[] events() -
header
-
ABI
public tech.deplant.java4ever.binding.Abi.ABI ABI() -
convertFunctionOutputs
public Map<String,Object> convertFunctionOutputs(String functionName, Map<String, Object> functionOutputs) throws tech.deplant.java4ever.binding.EverSdkExceptionChecks and converts provided Java Map containing inputs for function call to correct representation that will be accepted by ABI. If map doesn't meet ABI input structure, this method will fail. If some type doesn't have conversion, it will be serialized as is.- Parameters:
functionName-functionOutputs-- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
convertFunctionInputs
public Map<String,Object> convertFunctionInputs(String functionName, Map<String, Object> functionInputs) throws tech.deplant.java4ever.binding.EverSdkExceptionChecks and converts provided Java Map containing inputs for function call to correct representation that will be accepted by ABI. If map doesn't meet ABI input structure, this method will fail. If some type doesn't have conversion, it will be serialized as is.- Parameters:
functionName-functionInputs-- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
convertInitDataInputs
public Map<String,Object> convertInitDataInputs(Map<String, Object> initDataInputs) throws tech.deplant.java4ever.binding.EverSdkExceptionChecks and converts provided Java Map containing inputs for initialData to correct representation that will be accepted by ABI. If map doesn't meet ABI input structure, this method will fail. If some type doesn't have conversion, it will be serialized as is.- Parameters:
initDataInputs-- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
abiContract
public tech.deplant.java4ever.binding.Abi.AbiContract abiContract()Returns the value of theabiContractrecord component.- Returns:
- the value of the
abiContractrecord component
-