put

inline fun <T : Any> ContextBuilderDsl.put(noinline supplier: ScopedSupplier<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given supplier.

T is internally turned to a KClass.

Parameters

supplier

The lambda that will be executed to create an object.

T

The type of the component to add.


inline fun <T : Any> ContextBuilderDsl.put(qualifier: Qualifier, noinline supplier: ScopedSupplier<T>): ScopedSupplierDeclaration<T>
fun <T : Any> ContextBuilderDsl.put(    kclass: KClass<T>,     qualifier: Qualifier = EmptyQualifier,     supplier: ScopedSupplier<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given qualifier and supplier.

T is internally turned to a KClass. Qualifiers allow for differentiating between components that have the same type. See Identifier for more information.

Parameters

supplier

The lambda that will be executed to create an object.

qualifier

The qualifier for the underlying identifier.

T

The type of the component to add.


inline fun <T : Any> ContextBuilderDsl.put(supplier: KFunction<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given constructor.

T is internally turned to a KClass.

Parameters

supplier

The constructor for creating an object. This can be passed as a reference, e.g. ::MyClass.

T

The type of the component to add.


inline fun <T : Any> ContextBuilderDsl.put(qualifier: Qualifier, supplier: KFunction<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given qualifier and constructor.

T is internally turned to a KClass. Qualifiers allow for differentiating between components that have the same type. See Identifier for more information.

Parameters

supplier

The constructor for creating an object. This can be passed as a reference, e.g. ::MyClass.

qualifier

The qualifier for the type.

T

The type of the component to add.


fun <T : Any> ContextBuilderDsl.put(kclass: KClass<T>, supplier: KFunction<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given class and constructor.

Parameters

kclass

The class of the type T. This is useful for scenarios where it is not known at compile time. If the type is already known at compile time, you can remove the kclass parameter.

supplier

The constructor for creating an object. This can be passed as a reference, e.g. ::MyClass.

T

The type of the component to add.


fun <T : Any> ContextBuilderDsl.put(    kclass: KClass<T>,     qualifier: Qualifier,     supplier: KFunction<T>): ScopedSupplierDeclaration<T>

Add a definition of type T with the given class, qualifier and constructor.

Qualifiers allow for differentiating between components that have the same type. See Identifier for more information.

Parameters

kclass

The class of the type T. This is useful for scenarios where it is not known at compile time. If the type is already known at compile time, you can remove the kclass parameter.

qualifier

The qualifier for the type.

supplier

The constructor for creating an object. This can be passed as a reference, e.g. ::MyClass.

T

The type of the component to add.


fun ContextBuilderDsl.put(module: InjectableModule)

Add a module to the current definition. This adds all the declarations within the module to this context.

Parameters

module

The module that should be added.