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?)
The in context type.

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.
bindFullDescription
Link copied to clipboard
common
val bindFullDescription: String
Description using full type names.
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.
fullDescription
Link copied to clipboard
common
val fullDescription: String
Description using full type names.
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.