KFunctionAdapter

class KFunctionAdapter<T : OutputValue<*>>(function: KFunction<T>) : Function<T>

A Quarkdown Function adapted from a regular Kotlin KFunction.

Parameters

function

Kotlin function to adapt

Constructors

Link copied to clipboard
constructor(function: KFunction<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

If the Name annotation is present on function, the Quarkdown function name is set from there. Otherwise, it is function's original 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