factoryOrNull

inline fun <A : Any, T : Any> DIAware.factoryOrNull(tag: Any? = null): LazyDelegate<(A) -> T?>

Gets a factory of T for the given argument type, return type and tag, or nul if none is found.

A & T generics will be preserved!

Return

A factory, or null if no factory was found.

Parameters

A

The type of argument the factory takes.

T

The type of object the factory returns.

tag

The bound tag, if any.

Throws

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


inline fun <A : Any, T : Any> DirectDIAware.factoryOrNull(tag: Any? = null): (A) -> T?

Gets a factory of T for the given argument type, return type and tag, or nul if none is found.

A & T generics will be erased.

Return

A factory, or null if no factory was found.

Parameters

A

The type of argument the factory takes.

T

The type of object the factory returns.

tag

The bound tag, if any.

Throws

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


inline fun <A : Any, T : Any> Named.factoryOrNull(): LazyDelegate<(A) -> T?>

Gets a factory of T for the given argument type and return type, or nul if none is found. The name of the receiving property is used as tag.

A & T generics will be erased!

Return

A factory, or null if no factory was found.

Parameters

A

The type of argument the factory takes.

T

The type of object the factory returns.

Throws

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