Factory

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

Gets a factory of T for the given argument type and return type. The name of the receiving property is used as tag.

Return

A factory of T.

Parameters

A

The type of argument the returned factory takes.

T

The type of object to retrieve with the returned factory.

argType

The type of argument the returned factory takes.

type

The type of object to retrieve with the returned factory.

Throws

If no factory was found.

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