Key

data class Key<in C : Any, in A, out T : Any>(contextType: TypeToken<in C>, argType: TypeToken<in A>, type: TypeToken<out T>, 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

Key
Link copied to clipboard
common
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

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

Properties

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

The in argument type (Unit for a provider).

bindDescription
Link copied to clipboard
common
val bindDescription: String

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

bindFullDescription
Link copied to clipboard
common
val bindFullDescription: String

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

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

The in context type.

description
Link copied to clipboard
common
val description: String

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

fullDescription
Link copied to clipboard
common
val fullDescription: String

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

internalDescription
Link copied to clipboard
common
val internalDescription: String
tag
Link copied to clipboard
common
val tag: Any?

The associated tag.

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

The out type.