inline fun <reified R : Any> lazyInstanceOrNull(qualifier: Any? = null, generics: Boolean = false): Injector.InjectedProperty<R?>
Creates and registers a lazy property delegate for an optional instance of type R
.
The instance gets retrieved/created on first property access.
qualifier
- An optional qualifier.
generics
- Preserve generic type parameters.
Return
The created InjectedProperty.
inline fun <reified A, reified R : Any> lazyInstanceOrNull(argument: A, qualifier: Any? = null, generics: Boolean = false): Injector.InjectedProperty<R?>
Creates and registers a lazy property delegate for an optional instance of type R
.
This lookups a factory of type (A) -> R
and calls it with the supplied argument or
returns null if no factory of type (A) -> R
exists.
The instance gets retrieved/created on first property access.
argument
- The argument for the factory.
qualifier
- An optional qualifier.
generics
- Preserve generic type parameters.
Return
The created InjectedProperty.