Package org.fisco.bcos.sdk.abi.wrapper
Class ABIDefinition
java.lang.Object
org.fisco.bcos.sdk.abi.wrapper.ABIDefinition
public class ABIDefinition
extends java.lang.Object
ABIDefinition wrapper
Link https://solidity.readthedocs.io/en/develop/abi-spec.html#json
type: "function", "constructor", "receive" (the "receive Ether" function) or "fallback" (the
"default" function);
name: the name of the function;
inputs: an array of objects, each of which contains:
name: the name of the parameter.
type: the canonical type of the parameter (more below).
components: used for tuple types (more below).
outputs: an array of objects similar to inputs.
stateMutability: a string with one of the following values: pure (specified to not read
blockchain state), view (specified to not modify the blockchain state), nonpayable (function does
not accept Ether - the default) and payable (function accepts Ether).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classABIDefinition.NamedTypestatic classABIDefinition.Type -
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>CONSTANT_KEY -
Constructor Summary
Constructors Constructor Description ABIDefinition()ABIDefinition(boolean constant, java.util.List<ABIDefinition.NamedType> inputs, java.lang.String name, java.util.List<ABIDefinition.NamedType> outputs, java.lang.String type, boolean payable)ABIDefinition(boolean constant, java.util.List<ABIDefinition.NamedType> inputs, java.lang.String name, java.util.List<ABIDefinition.NamedType> outputs, java.lang.String type, boolean payable, java.lang.String stateMutability)ABIDefinition(java.lang.String name, java.lang.String type, boolean constant, boolean payable, boolean anonymous, java.lang.String stateMutability) -
Method Summary
Modifier and Type Method Description static ABIDefinitioncreateDefaultConstructorABIDefinition()booleanequals(java.lang.Object o)java.util.List<ABIDefinition.NamedType>getInputs()java.lang.StringgetMethodId(CryptoSuite cryptoSuite)calculate the method idjava.lang.StringgetMethodSignatureAsString()string method signaturejava.lang.StringgetName()java.util.List<ABIDefinition.NamedType>getOutputs()java.lang.StringgetStateMutability()java.lang.StringgetType()inthashCode()booleanhasOutputs()booleanisAnonymous()booleanisConstant()booleanisPayable()voidsetAnonymous(boolean anonymous)voidsetConstant(boolean constant)voidsetInputs(java.util.List<ABIDefinition.NamedType> inputs)voidsetName(java.lang.String name)voidsetOutputs(java.util.List<ABIDefinition.NamedType> outputs)voidsetPayable(boolean payable)voidsetStateMutability(java.lang.String stateMutability)voidsetType(java.lang.String type)
-
Field Details
-
CONSTANT_KEY
public static java.util.List<java.lang.String> CONSTANT_KEY
-
-
Constructor Details
-
ABIDefinition
public ABIDefinition() -
ABIDefinition
public ABIDefinition(java.lang.String name, java.lang.String type, boolean constant, boolean payable, boolean anonymous, java.lang.String stateMutability) -
ABIDefinition
public ABIDefinition(boolean constant, java.util.List<ABIDefinition.NamedType> inputs, java.lang.String name, java.util.List<ABIDefinition.NamedType> outputs, java.lang.String type, boolean payable) -
ABIDefinition
public ABIDefinition(boolean constant, java.util.List<ABIDefinition.NamedType> inputs, java.lang.String name, java.util.List<ABIDefinition.NamedType> outputs, java.lang.String type, boolean payable, java.lang.String stateMutability)
-
-
Method Details
-
createDefaultConstructorABIDefinition
-
getMethodSignatureAsString
public java.lang.String getMethodSignatureAsString()string method signature- Returns:
- the method signature string
-
getMethodId
calculate the method id- Parameters:
cryptoSuite- the crypto suite used for hash calculation- Returns:
- the method id
-
isConstant
public boolean isConstant() -
setConstant
public void setConstant(boolean constant) -
getInputs
-
setInputs
-
getName
public java.lang.String getName() -
setName
public void setName(java.lang.String name) -
getOutputs
-
hasOutputs
public boolean hasOutputs() -
setOutputs
-
getType
public java.lang.String getType() -
setType
public void setType(java.lang.String type) -
isPayable
public boolean isPayable() -
setPayable
public void setPayable(boolean payable) -
getStateMutability
public java.lang.String getStateMutability() -
setStateMutability
public void setStateMutability(java.lang.String stateMutability) -
isAnonymous
public boolean isAnonymous() -
setAnonymous
public void setAnonymous(boolean anonymous) -
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-