NoArgBindingDI

interface NoArgBindingDI<out C : Any> : DirectDI, WithContext<C>

Direct DI interface to be passed to provider methods that hold references.

It is augmented to allow such methods to access the context of the retrieval, as well as a provider or instance from the binding it is overriding (if it is overriding).

Parameters

C

The type of the context

Properties

Link copied to clipboard
abstract val container: DIContainer

Every methods eventually ends up to a call to this container.

Link copied to clipboard
abstract val context: C

The context that was given at retrieval.

Link copied to clipboard
open val di: DI

Returns a regular DI instance (DI is lazy by default).

Link copied to clipboard
abstract val directDI: DirectDI

A Direct DI Aware class must be within reach of a DirectDI object.

Link copied to clipboard
abstract val lazy: DI

Returns a regular DI instance (DI is lazy by default).

Link copied to clipboard

Returns a regular DI instance (DI is lazy by default).

Functions

Link copied to clipboard
inline fun <A : Any, T : Any> DirectDI.allFactories(tag: Any? = null): List<(A) -> T>

Gets all factories that can return a T for the given argument type, return type and tag.

Link copied to clipboard
abstract fun <A, T : Any> Factory(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null): (A) -> T

Gets a factory of T for the given argument type, return type and tag.

Link copied to clipboard
inline fun <A : Any, T : Any> DirectDI.factory(tag: Any? = null): (A) -> T

Gets a factory of T for the given argument type, return type and tag.

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

Gets a factory of T for the given argument type, return type and tag.

Link copied to clipboard
abstract fun <A, T : Any> FactoryOrNull(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null): (A) -> T?

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

Link copied to clipboard
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.

Link copied to clipboard
abstract fun <T : Any> Instance(type: TypeToken<T>, tag: Any? = null): T

Gets an instance of T for the given type and tag.

abstract fun <A, T : Any> Instance(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null, arg: A): T

Gets an instance of T for the given type and tag, curried from a factory for the given argument type.

Link copied to clipboard
inline fun <T : Any> DirectDIAware.instance(tag: Any? = null): T

Gets an instance of T for the given type and tag.

inline fun <A : Any, T : Any> DirectDIAware.instance(tag: Any? = null, arg: A): T
inline fun <A, T : Any> DirectDIAware.instance(tag: Any? = null, arg: Typed<A>): T

Gets an instance of T for the given type and tag, curried from a factory for the given argument.

Link copied to clipboard
abstract fun <T : Any> InstanceOrNull(type: TypeToken<T>, tag: Any? = null): T?

Gets an instance of T for the given type and tag, or null if none is found.

abstract fun <A, T : Any> InstanceOrNull(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null, arg: A): T?

Gets an instance of T for the given type and tag, curried from a factory for the given argument type, or null if none is found.

Link copied to clipboard
inline fun <T : Any> DirectDIAware.instanceOrNull(tag: Any? = null): T?

Gets an instance of T for the given type and tag, or null if none is found.

inline fun <A : Any, T : Any> DirectDIAware.instanceOrNull(tag: Any? = null, arg: A): T?
inline fun <A, T : Any> DirectDIAware.instanceOrNull(tag: Any? = null, arg: Typed<A>): T?

Gets an instance of T for the given type and tag, curried from a factory for the given argument, or null if none is found.

Link copied to clipboard
inline fun <T> DirectDIAware.new(constructor: () -> T): T

Auto resolve a class dependencies by using its constructor reference. The resolution is done at compile time by leveraging inline functions, no reflection is required.

inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) -> T): T
inline fun <T, P1> DirectDIAware.new(constructor: (P1) -> T): T
inline fun <T, P1, P2> DirectDIAware.new(constructor: (P1, P2) -> T): T
inline fun <T, P1, P2, P3> DirectDIAware.new(constructor: (P1, P2, P3) -> T): T
inline fun <T, P1, P2, P3, P4> DirectDIAware.new(constructor: (P1, P2, P3, P4) -> T): T
inline fun <T, P1, P2, P3, P4, P5> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9) -> T): T
Link copied to clipboard
inline fun <T> DirectDIAware.newInstance(creator: DirectDI.() -> T): T

Allows the creation of a new instance with DI injection.

Link copied to clipboard
abstract fun On(context: DIContext<*>): DirectDI

Returns a DirectDI with its context changed.

Link copied to clipboard
inline fun <C : Any> DirectDIAware.on(context: C): DirectDI

Returns a DirectDI with its context and/or receiver changed.

Link copied to clipboard
abstract fun overriddenInstance(): Any

Gets an instance from the overridden binding.

Link copied to clipboard
abstract fun overriddenInstanceOrNull(): Any?

Gets an instance from the overridden binding, if this binding overrides an existing binding.

Link copied to clipboard
abstract fun overriddenProvider(): () -> Any

Gets a provider from the overridden binding.

Link copied to clipboard
abstract fun overriddenProviderOrNull(): () -> Any?

Gets a provider from the overridden binding, if this binding overrides an existing binding.

Link copied to clipboard
abstract fun <T : Any> Provider(type: TypeToken<T>, tag: Any? = null): () -> T

Gets a provider of T for the given type and tag.

abstract fun <A, T : Any> Provider(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null, arg: () -> A): () -> T

Gets a provider of T for the given type and tag, curried from a factory for the given argument type.

Link copied to clipboard
inline fun <T : Any> DirectDIAware.provider(tag: Any? = null): () -> T

Gets a provider of T for the given type and tag.

inline fun <A : Any, T : Any> DirectDIAware.provider(tag: Any? = null, arg: A): () -> T
inline fun <A : Any, T : Any> DirectDIAware.provider(tag: Any? = null, noinline fArg: () -> A): () -> T
inline fun <A, T : Any> DirectDIAware.provider(tag: Any? = null, arg: Typed<A>): () -> T

Gets a provider of T for the given type and tag, curried from a factory for the given argument.

Link copied to clipboard
abstract fun <T : Any> ProviderOrNull(type: TypeToken<T>, tag: Any? = null): () -> T?

Gets a provider of T for the given type and tag, or null if none is found.

abstract fun <A, T : Any> ProviderOrNull(argType: TypeToken<in A>, type: TypeToken<T>, tag: Any? = null, arg: () -> A): () -> T?

Gets a provider of T for the given type and tag, curried from a factory for the given argument type, or null if none is found.

Link copied to clipboard
inline fun <T : Any> DirectDIAware.providerOrNull(tag: Any? = null): () -> T?

Gets a provider of T for the given type and tag, or null if none is found.

inline fun <A : Any, T : Any> DirectDIAware.providerOrNull(tag: Any? = null, arg: A): () -> T?
inline fun <A : Any, T : Any> DirectDIAware.providerOrNull(tag: Any? = null, noinline fArg: () -> A): () -> T?
inline fun <A, T : Any> DirectDIAware.providerOrNull(tag: Any? = null, arg: Typed<A>): () -> T?

Gets a provider of T for the given type and tag, curried from a factory for the given argument, or null if none is found.