Factory

fun <A, T : Any> DIAware.Factory(argType: TypeToken<in A>, type: TypeToken<out T>, tag: Any? = null): DIProperty<(A) -> T>

Gets a factory of T for the given argument type, return type and 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.

tag

The bound tag, if any.

Throws

If no factory was found.

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