Provider

class Provider<C : Any, T : Any>(    val contextType: TypeToken<in C>,     val createdType: TypeToken<out T>,     val creator: NoArgBindingDI<C>.() -> T) : NoArgDIBinding<C, T>

Concrete provider: each time an instance is needed, the function creator function will be called.

A provider is like a Factory, but without argument.

Parameters

T

The created type.

createdType

The type of objects created by this provider, used for debug print only.

Constructors

Link copied to clipboard
fun <C : Any, T : Any> Provider(    contextType: TypeToken<in C>,     createdType: TypeToken<out T>,     creator: NoArgBindingDI<C>.() -> T)

Functions

Link copied to clipboard
open fun factoryFullName(): String

The full(er) name of this factory, used for debug print only.

Link copied to clipboard
open override fun factoryName(): String

The name of this factory, used for debug print only.

Link copied to clipboard
open override fun getFactory(key: DI.Key<C, Unit, T>, di: BindingDI<C>): (Unit) -> T

Properties

Link copied to clipboard
open override val argType: TypeToken<Unit>

The type of the argument this factory will function for.

Link copied to clipboard
open override val contextType: TypeToken<in C>

The type of contexts that are to be set when using this factory.

Link copied to clipboard
open val copier: DIBinding.Copier<C, Unit, T>?

A copier that is responsible for copying / resetting the binding. If null, it means that the binding do not hold any reference or status and need not be copied.

Link copied to clipboard
open override val createdType: TypeToken<out T>
Link copied to clipboard
val creator: NoArgBindingDI<C>.() -> T

The function that will be called each time an instance is requested. Should create a new instance.

Link copied to clipboard
open val description: String

The description of this factory (using simple type names), used for debug print only.

Link copied to clipboard
open val fullDescription: String

The description of this factory (using full type names), used for debug print only.

Link copied to clipboard
open val scope: Scope<C>?

The scope used by this factory, if any

Link copied to clipboard
open val supportSubTypes: Boolean

Whether this bindings supports subtype handling.