InstanceBinding

class InstanceBinding<T : Any>(val createdType: TypeToken<out T>, val instance: T) : NoArgDIBinding<Any, T>

Concrete instance provider: will always return the given instance.

Parameters

T

The type of the instance.

createdType

The type of the object, used for debug print only.

Constructors

Link copied to clipboard
fun <T : Any> InstanceBinding(createdType: TypeToken<out T>, instance: T)

Functions

Link copied to clipboard

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<Any, Unit, T>, di: BindingDI<Any>): (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<Any>

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

Link copied to clipboard

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
open override val description: String

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

Link copied to clipboard
open override val fullDescription: String

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

Link copied to clipboard
val instance: T

The object that will always be returned.

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

The scope used by this factory, if any

Link copied to clipboard

Whether this bindings supports subtype handling.