Provider

fun <T : Any> Provider(type: TypeToken<out T>): DIProperty<() -> T>

Gets a provider of T for the given type. The name of the receiving property is used as 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.

Throws

If no provider was found.

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


fun <A, T : Any> Provider(    argType: TypeToken<in A>,     type: TypeToken<out T>,     arg: () -> A): DIProperty<() -> T>

Gets a provider of T for the given type, curried from a factory that takes an argument A. The name of the receiving property is used as tag.

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.

argType

The type of argument the curried factory takes.

type

The type of object to retrieve with the returned provider.

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.