DIAware

interface DIAware

Any class that extends this interface can use DI "seamlessly".

Properties

di
Link copied to clipboard
common
abstract val di: DI
A DI Aware class must be within reach of a DI object.
diContext
Link copied to clipboard
common
open val diContext: DIContext<*>
A DI Aware class can define a context that is for all retrieval by overriding this property.
diTrigger
Link copied to clipboard
common
open val diTrigger: DITrigger?
Trigger to use that define when the retrieval will be done.

Inheritors

DI
Link copied to clipboard

Extensions

AllFactories
Link copied to clipboard
inline fun <A : Any, T : Any> DIAware.allFactories(tag: Any? = null): DIProperty<List<(A) -> T>>
Gets all factories that match the the given argument type, return type and tag.
AllInstances
Link copied to clipboard
inline fun <T : Any> DIAware.allInstances(tag: Any? = null): DIProperty<List<T>>
Gets all instances from providers that match the the given return type and tag.
inline fun <A : Any, T : Any> DIAware.allInstances(tag: Any? = null, arg: A): DIProperty<List<T>>
Gets all instances from providers that match the the given return type and tag, curried from factories that take an argument A.
inline fun <A, T : Any> DIAware.allInstances(tag: Any? = null, arg: Typed<A>): DIProperty<List<T>>
Gets all instances from providers that match the the given return type and tag, curried from factories that take an argument A.
inline fun <A : Any, T : Any> DIAware.allInstances(tag: Any? = null, noinline fArg: () -> A): DIProperty<List<T>>
Gets all instances from providers that match the the given return type and tag, curried from factories that take an argument A.
AllProviders
Link copied to clipboard
inline fun <T : Any> DIAware.allProviders(tag: Any? = null): DIProperty<List<() -> T>>
Gets all providers that match the the given return type and tag.
inline fun <A : Any, T : Any> DIAware.allProviders(tag: Any? = null, arg: A): DIProperty<List<() -> T>>
Gets all providers that match the the given return type and tag, curried from factories that take an argument A.
inline fun <A, T : Any> DIAware.allProviders(tag: Any? = null, arg: Typed<A>): DIProperty<List<() -> T>>
Gets all providers that match the the given return type and tag, curried from factories that take an argument A.
inline fun <A : Any, T : Any> DIAware.allProviders(tag: Any? = null, noinline fArg: () -> A): DIProperty<List<() -> T>>
Gets all providers that match the the given return type and tag, curried from factories that take an argument A.
Constant
Link copied to clipboard
common
inline fun <T : Any> DIAware.constant(): DIProperty<T>
Gets a constant of type T and tag whose tag is the name of the receiving property.
direct
Link copied to clipboard
common
val DIAware.direct: DirectDI
Return a direct DirectDI instance, with its receiver and context set to this DIAware receiver and context.
Factory
Link copied to clipboard
common
inline fun <A : Any, T : Any> DIAware.factory(tag: Any? = null): DIProperty<(A) -> T>
Gets a factory of T for the given argument type, return type and tag.
FactoryOrNull
Link copied to clipboard
common
inline fun <A : Any, T : Any> DIAware.factoryOrNull(tag: Any? = null): DIProperty<(A) -> T?>
Gets a factory of T for the given argument type, return type and tag, or nul if none is found.
Instance
Link copied to clipboard
common
inline fun <T : Any> DIAware.instance(tag: Any? = null): DIProperty<T>
Gets an instance of T for the given type and tag.
inline fun <A : Any, T : Any> DIAware.instance(tag: Any? = null, arg: A): DIProperty<T>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A.
inline fun <A, T : Any> DIAware.instance(tag: Any? = null, arg: Typed<A>): DIProperty<T>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A.
inline fun <A : Any, T : Any> DIAware.instance(tag: Any? = null, noinline fArg: () -> A): DIProperty<T>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A.
InstanceOrNull
Link copied to clipboard
common
inline fun <T : Any> DIAware.instanceOrNull(tag: Any? = null): DIProperty<T?>
Gets an instance of T for the given type and tag, or null if none is found.
inline fun <A : Any, T : Any> DIAware.instanceOrNull(tag: Any? = null, arg: A): DIProperty<T?>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.
inline fun <A, T : Any> DIAware.instanceOrNull(tag: Any? = null, arg: Typed<A>): DIProperty<T?>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.
inline fun <A : Any, T : Any> DIAware.instanceOrNull(tag: Any? = null, noinline fArg: () -> A): DIProperty<T?>
Gets an instance of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.
named
Link copied to clipboard
common
val DIAware.named: Named
Allows to get factories / providers / instances with a tag set to the name of the receiving property.
newInstance
Link copied to clipboard
common
fun <T> DIAware.newInstance(creator: DirectDI.() -> T): DIProperty<T>
Allows to create a new instance of an unbound object with the same API as when bounding one.
On
Link copied to clipboard
common
inline fun <C : Any> DIAware.on(context: C, trigger: DITrigger? = this.diTrigger): DI
Allows to create a new DI object with a context and/or a trigger set.
inline fun <C : Any> DIAware.on(trigger: DITrigger? = this.diTrigger, crossinline getContext: () -> C): DI
Allows to create a new DI object with a context and/or a trigger set.
fun DIAware.on(trigger: DITrigger?): DI
Allows to create a new DI object with a trigger set.
Provider
Link copied to clipboard
common
inline fun <T : Any> DIAware.provider(tag: Any? = null): DIProperty<() -> T>
Gets a provider of T for the given type and tag.
inline fun <A : Any, T : Any> DIAware.provider(tag: Any? = null, arg: A): DIProperty<() -> T>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A.
inline fun <A, T : Any> DIAware.provider(tag: Any? = null, arg: Typed<A>): DIProperty<() -> T>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A.
inline fun <A : Any, T : Any> DIAware.provider(tag: Any? = null, noinline fArg: () -> A): DIProperty<() -> T>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A.
ProviderOrNull
Link copied to clipboard
common
inline fun <T : Any> DIAware.providerOrNull(tag: Any? = null): DIProperty<() -> T?>
Gets a provider of T for the given type and tag, or null if none is found.
inline fun <A : Any, T : Any> DIAware.providerOrNull(tag: Any? = null, arg: A): DIProperty<() -> T?>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.
inline fun <A, T : Any> DIAware.providerOrNull(tag: Any? = null, arg: Typed<A>): DIProperty<() -> T?>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.
inline fun <A : Any, T : Any> DIAware.providerOrNull(tag: Any? = null, noinline fArg: () -> A): DIProperty<() -> T?>
Gets a provider of T for the given type and tag, curried from a factory that takes an argument A, or null if none is found.