java.lang.Object
com.hedera.hashgraph.sdk.ContractFunctionSelector
Builder class for Solidity function selectors.
-
Constructor Summary
ConstructorsConstructorDescriptionContractFunctionSelector(String funcName) Start building a selector for a function with a given name. -
Method Summary
Modifier and TypeMethodDescriptionAdd an address parameter.Add an address array parameter.addBool()Add a bool parameter.addBytes()Add a bytes parameter.Add a bytes 32 parameter.Add a bytes 32 array parameter.Add a bytes array parameter.Add a function parameter.Add an int 256 parameter.Add an int 256 array parameter.addInt32()Add an int 32 parameter.Add an int 32 array parameter.addInt64()Add an int 64 parameter.Add an int 64 array parameter.addInt8()Add an int 8 parameter.Add an int 8 array parameter.(package private) ContractFunctionSelectoraddParamType(String typeName) Add a Solidity type name to this selector;Add a string parameter.Add a string array parameter.Add an unsigned int 256 parameter.Add an unsigned int 256 array parameter.Add an unsigned int 32 parameter.Add an unsigned int 32 array parameter.Add an unsigned int 64 parameter.Add an unsigned int 64 array parameter.addUint8()Add an unsigned int 8 parameter.Add an unsigned int 8 array parameter.(package private) byte[]finish()Complete the function selector after all parameters have been added and get the selector bytes.
-
Constructor Details
-
ContractFunctionSelector
Start building a selector for a function with a given name.- Parameters:
funcName- The name of the function
-
-
Method Details
-
addString
Add a string parameter.- Returns:
- string
-
addStringArray
Add a string array parameter.- Returns:
- array string
-
addBytes
Add a bytes parameter.- Returns:
- bytes
-
addBytesArray
Add a bytes array parameter.- Returns:
- bytes array
-
addBytes32
Add a bytes 32 parameter.- Returns:
- bytes 32
-
addBytes32Array
Add a bytes 32 array parameter.- Returns:
- bytes 32 array
-
addBool
Add a bool parameter.- Returns:
- bool
-
addInt8
Add an int 8 parameter.- Returns:
- int 8
-
addInt32
Add an int 32 parameter.- Returns:
- int 32
-
addInt64
Add an int 64 parameter.- Returns:
- int 64
-
addInt256
Add an int 256 parameter.- Returns:
- int 256
-
addInt8Array
Add an int 8 array parameter.- Returns:
- int 8 array
-
addInt32Array
Add an int 32 array parameter.- Returns:
- int 32 array
-
addInt64Array
Add an int 64 array parameter.- Returns:
- int 64 array
-
addInt256Array
Add an int 256 array parameter.- Returns:
- int 256 array
-
addUint8
Add an unsigned int 8 parameter.- Returns:
- unsigned int 8
-
addUint32
Add an unsigned int 32 parameter.- Returns:
- unsigned int 32
-
addUint64
Add an unsigned int 64 parameter.- Returns:
- unsigned int 64
-
addUint256
Add an unsigned int 256 parameter.- Returns:
- unsigned int 256
-
addUint8Array
Add an unsigned int 8 array parameter.- Returns:
- unsigned int 8 array
-
addUint32Array
Add an unsigned int 32 array parameter.- Returns:
- unsigned int 32 array
-
addUint64Array
Add an unsigned int 64 array parameter.- Returns:
- unsigned int 64 array
-
addUint256Array
Add an unsigned int 256 array parameter.- Returns:
- unsigned int 256 array
-
addAddress
Add an address parameter.- Returns:
- address
-
addAddressArray
Add an address array parameter.- Returns:
- address array
-
addFunction
Add a function parameter.- Returns:
- function.
-
addParamType
Add a Solidity type name to this selector;- Parameters:
typeName- the name of the Solidity type for a parameter.- Returns:
this- Throws:
IllegalStateException- iffinish()has already been called.
-
finish
byte[] finish()Complete the function selector after all parameters have been added and get the selector bytes.No more parameters may be added after this method call.
However, this can be called multiple times; it will always return the same result.
- Returns:
- the computed selector bytes.
-