SimpleFunction

data class SimpleFunction<T : OutputValue<*>>(val name: String, val parameters: List<FunctionParameter<*>>, val validators: List<FunctionCallValidator<T>> = emptyList(), val invoke: (ArgumentBindings) -> T) : Function<T>

A basic Function implementation.

See also

Constructors

Link copied to clipboard
constructor(name: String, parameters: List<FunctionParameter<*>>, validators: List<FunctionCallValidator<T>> = emptyList(), invoke: (ArgumentBindings) -> T)

Properties

Link copied to clipboard
open override val invoke: (ArgumentBindings) -> T

Function that maps the input arguments into an output value. Arguments and parameters compliance in terms of matching types and count is not checked here. The ArgumentBindings allow looking up argument values by their parameter.

Link copied to clipboard
open override val name: String

Function name.

Link copied to clipboard
open override val parameters: List<FunctionParameter<*>>

Declared parameters.

Link copied to clipboard
open override val validators: List<FunctionCallValidator<T>>

Validators that check the validity of a function call towards this function. If a condition is not met during the validation, an exception should be thrown.

Functions

Link copied to clipboard
fun Function<*>.signatureAsString(includeName: Boolean = true): String