Instance Or Null
Gets an instance of T for the given type, or null if none is found. The name of the receiving property is used as tag.
Return
An instance of T, or null if no provider was found.
Parameters
type
The type of object to retrieve.
Throws
If the value construction triggered a dependency loop.
fun <A, T : Any> InstanceOrNull(argType: TypeToken<in A>, type: TypeToken<out T>, arg: () -> A): DIProperty<T?>
Gets an instance of T for the given type, curried from a factory that takes an argument A, or null if none is found. The name of the receiving property is used as tag.
Return
An instance of T, or null if no factory was found.
Parameters
A
The type of argument the curried factory takes.
T
The type of object to retrieve.
type
The type of object to retrieve.
arg
A function that returns the argument that will be given to the factory when curried.
Throws
If the value construction triggered a dependency loop.