Bind

abstract fun <T : Any> Bind(    tag: Any? = null,     overrides: Boolean? = null,     binding: DIBinding<*, *, T>)

Attaches the binding of a given type with a given tag.

Parameters

T

The type of value to bind.

tag

The tag to bind.

overrides

Whether this bind must or must not override an existing binding.


abstract fun <T : Any> Bind(    type: TypeToken<out T>,     tag: Any? = null,     overrides: Boolean? = null): DI.Builder.TypeBinder<T>

Starts the binding of a given type with a given tag.

Return

The binder: call TypeBinder.with) on it to finish the binding syntax and register the binding.

Parameters

T

The type of value to bind.

type

The type to bind.

tag

The tag to bind.

overrides

Whether this bind must or must not override an existing binding.


abstract fun Bind(tag: Any? = null, overrides: Boolean? = null): DI.Builder.DirectBinder

Starts a direct binding with a given tag. A direct bind does not define the type to be bound, the type will be defined according to the bound factory.

Return

The binder: call DirectBinder.from) on it to finish the binding syntax and register the binding.

Parameters

tag

The tag to bind.

overrides

Whether this bind must or must not override an existing binding.