WithScope

interface WithScope<C : Any> : DI.BindBuilder<C>

Used to define bindings with a scope.

Parameters

C

The scope's Context.

Properties

contextType
Link copied to clipboard
common
abstract val contextType: TypeToken<C>
The context type that will be used by all bindings that are defined in this DSL context.
explicitContext
Link copied to clipboard
common
abstract val explicitContext: Boolean
scope
Link copied to clipboard
common
abstract val scope: Scope<C>
The scope that will be used by all bindings that are defined in this DSL context.

Inheritors

DI
Link copied to clipboard

Extensions

multiton
Link copied to clipboard
common
inline fun <C : Any, A : Any, T : Any> DI.BindBuilder.WithScope<C>.multiton(ref: RefMaker? = null, sync: Boolean = true, noinline creator: BindingDI<C>.(A) -> T): Multiton<C, A, T>
Creates a multiton: will create an instance on first request for each different argument and will subsequently always return the same instance for the same argument.
singleton
Link copied to clipboard
common
inline fun <C : Any, T : Any> DI.BindBuilder.WithScope<C>.singleton(ref: RefMaker? = null, sync: Boolean = true, noinline creator: NoArgBindingDI<C>.() -> T): Singleton<C, T>
Creates a singleton: will create an instance on first request and will subsequently always return the same instance.