DependencyKey

data class DependencyKey<T>(val token: TypeToken<T>, val qualifier: Annotation? = null)

A representation of a binding "key" for Mockspresso's dependency Map. Every dependency in mockspresso is bound by a TypeToken and an optional qualifier Annotation.

NOTE: In practice it's best to avoid using the primary constructor to create DependencyKeys. Prefer the dependencyKey method which uses a reified type to ensure type data is captured completely.

Constructors

Link copied to clipboard
fun <T> DependencyKey(token: TypeToken<T>, qualifier: Annotation? = null)

Properties

Link copied to clipboard
val qualifier: Annotation? = null
Link copied to clipboard
val token: TypeToken<T>