inline fun <reified R : Any> instanceOrNull(qualifier: Any? = null, generics: Boolean = false): R?
Retrieve an optional instance of R
.
qualifier
- An optional qualifier of the dependency.
generics
- Preserves generic type parameters if set to true (default = false).
Return
An instance of R
or null if provider doesn't exist.