Key

data class Key<in C : Any, in A, out T : Any>(val contextType: TypeToken<in C>, val argType: TypeToken<in A>, val type: TypeToken<out T>, val tag: Any?)

In DI, each DIBinding is bound to a Key. A Key holds all information necessary to retrieve a factory (and therefore an instance).

A key contains many types & a tag. It defines the types of the values that will be passed to and retrieved from DI, not the values themselves.

Parameters

C

The in context type.

A

The in argument type (Unit for a provider).

T

The out type.

Constructors

Link copied to clipboard
fun <in C : Any, in A, out T : Any> Key(contextType: TypeToken<in C>, argType: TypeToken<in A>, type: TypeToken<out T>, tag: Any?)

Functions

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

Properties

Link copied to clipboard
val argType: TypeToken<in A>

The in argument type (Unit for a provider).

Link copied to clipboard

Description using simple type names. The description is as close as possible to the code used to create this bind.

Link copied to clipboard

Description using full type names. The description is as close as possible to the code used to create this bind.

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

The in context type.

Link copied to clipboard

Description using simple type names. The description is as close as possible to the code used to create this key.

Link copied to clipboard

Description using full type names. The description is as close as possible to the code used to create this key.

Link copied to clipboard
Link copied to clipboard
val tag: Any?

The associated tag.

Link copied to clipboard
val type: TypeToken<out T>

The out type.