Context

A context contains mappings from ContextParamType to value. Each context has an intention that defines which parameters are allowed and required.

With Context.intention, you can create a new context builder for the given intention.

Parameters

I

The intention of this context.

intention

The intention of this context.

explicitParams

The parameters that are explicitly set.

resolvedParams

The parameters that are loaded through autofillers. The value is null if the param could not be loaded through autofillers.

Types

Link copied to clipboard

Builder for Context.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun <V : Any> get(paramType: ContextParamType<V>): V?

Returns the value of the given paramType or null if it is not present and could not be resolved through autofillers.

operator fun <V : Any> get(paramType: DefaultingContextParamType<V>): V

Returns the value of the given paramType, falling back to the default value if the param type is not present and could not be resolved through autofillers.

Link copied to clipboard
fun <V : Any> getOrThrow(paramType: ContextParamType<V>): V

Returns the value of the given paramType or throws an exception if it is not present and also couldn't be resolved through autofillers.