Eager Singleton
class EagerSingleton<T : Any>( builder: DIContainer.Builder, val createdType: TypeToken<out T>, val creator: NoArgBindingDI<Any>.() -> T) : NoArgDIBinding<Any, T>
Content copied to clipboard
Concrete eager singleton: will create an instance as soon as di is ready (all bindings are set) and will always return this instance.
Parameters
T
The created type.
created Type
The type of the created object.
creator
The function that will be called as soon as DI is ready. Guaranteed to be called only once. Should create a new instance.
Constructors
Link copied to clipboard
fun <T : Any> EagerSingleton( builder: DIContainer.Builder, createdType: TypeToken<out T>, creator: NoArgBindingDI<Any>.() -> T)
Content copied to clipboard
Functions
Link copied to clipboard
The full(er) name of this factory, used for debug print only.
Link copied to clipboard
The name of this factory, used for debug print only.
Link copied to clipboard