public abstract class JacksonBasedFunction
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected T |
contractContext |
protected T |
contractProperties |
Constructor and Description |
---|
JacksonBasedFunction() |
Modifier and Type | Method and Description |
---|---|
protected T |
getContractContext()
Returns a contract context given from a contract that is executed together with the function.
|
protected T |
getContractProperties() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
abstract T |
invoke(Database<G,S,P,D,R> database,
T functionArgument,
T contractArgument,
T contractProperties)
Invokes the function to
Database with the specified argument and the corresponding root
contract argument and properties. |
protected T |
invoke(java.lang.String functionId,
Database<G,S,P,D,R> database,
T functionArgument,
T contractArgument) |
boolean |
isRoot() |
protected T contractProperties
protected T contractContext
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
@Nullable protected T getContractProperties()
public boolean isRoot()
@Nullable protected T getContractContext()
@Nullable public abstract T invoke(Database<G,S,P,D,R> database, @Nullable T functionArgument, T contractArgument, @Nullable T contractProperties)
Database
with the specified argument and the corresponding root
contract argument and properties. An implementation of the FunctionBase
should throw
ContractContextException
if it faces application-level contextual error (such as lack
of balance in payment application).database
- mutable databasefunctionArgument
- function argumentcontractArgument
- the argument of the corresponding root contractcontractProperties
- the pre-registered properties of the corresponding root contract@Nullable protected final T invoke(java.lang.String functionId, Database<G,S,P,D,R> database, @Nullable T functionArgument, T contractArgument)