Context

interface Context<I : ContextIntention<I>>

A context maps ContextParamTypes to a values. Each context has an intention that defines which parameters are allowed and required.

See also

Types

Link copied to clipboard
interface Builder<I : ContextIntention<I>>

Builder for Context.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val intention: I

The intention of this context.

Functions

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

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

abstract operator fun <V : Any> get(paramType: DefaultingContextParamType<V, I>): 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.

abstract operator fun <V : Any> get(paramType: RequiredContextParamType<V, I>): V

Returns the value of the given paramType.

Link copied to clipboard
abstract fun toBuilder(): Context.Builder<I>

Creates a context builder that is initialized with the explicitly defined parameters of this context.