Eager Singleton
class EagerSingleton<T : Any>(builder: DIContainer.Builder, val createdType: TypeToken<out T>, val creator: NoArgBindingDI<Any>.() -> T) : NoArgDIBinding<Any, T>
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
constructor(builder: DIContainer.Builder, createdType: TypeToken<out T>, creator: NoArgBindingDI<Any>.() -> T)
Properties
Link copied to clipboard
The type of contexts that are to be set when using this factory.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The description of this factory (using simple type names), used for debug print only.
Link copied to clipboard
The description of this factory (using full type names), used for debug print only.
Link copied to clipboard
Whether this bindings supports subtype handling.