Provider

abstract fun <T : Any> Provider(type: TypeToken<T>, tag: Any? = null): () -> T

Gets a provider of T for the given type and tag.

Return

A provider of T.

Parameters

T

The type of object to retrieve with the returned provider.

type

The type of object to retrieve with the returned provider.

tag

The bound tag, if any.

Throws

If no provider was found.

When calling the provider, if the value construction triggered a dependency loop.


abstract fun <A, T : Any> Provider(    argType: TypeToken<in A>,     type: TypeToken<T>,     tag: Any? = null,     arg: () -> A): () -> T

Gets a provider of T for the given type and tag, curried from a factory for the given argument type.

Return

A provider of T.

Parameters

A

The type of argument the curried factory takes.

T

The type of object to retrieve with the returned provider.

type

The type of object to retrieve with the returned provider.

tag

The bound tag, if any.

arg

A function that returns the argument that will be given to the factory when curried.

Throws

If no provider was found.

When calling the provider, if the value construction triggered a dependency loop.