BindingDI

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

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

It is augmented to allow such methods to access the context of the retrieval, as well as a factory 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>
inline fun <A : Any, T : Any> DirectDIAware.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
inline fun <T : Any> DirectDIAware.allInstances(tag: Any? = null): List<T>

Gets all instances that can return a T for the given type and tag.

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

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

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

Gets all providers that can return a T for the given type and tag.

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

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

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> DirectDIAware.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> DirectDI.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, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> T): T
inline fun <T, P1> DirectDIAware.new(constructor: (P1) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> T): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> 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
inline fun <T, P1, P2> DirectDIAware.new(constructor: (P1, P2) -> T, a1: P1 = instance(), a2: P2 = instance()): T
inline fun <T, P1, P2, P3> DirectDIAware.new(constructor: (P1, P2, P3) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance()): T
inline fun <T, P1, P2, P3, P4> DirectDIAware.new(constructor: (P1, P2, P3, P4) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance()): T
inline fun <T, P1, P2, P3, P4, P5> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance()): 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, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance()): T
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, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance(), a18: P18 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance(), a18: P18 = instance(), a19: P19 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance(), a18: P18 = instance(), a19: P19 = instance(), a20: P20 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance(), a18: P18 = instance(), a19: P19 = instance(), a20: P20 = instance(), a21: P21 = instance()): T
inline fun <T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22> DirectDIAware.new(constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> T, a1: P1 = instance(), a2: P2 = instance(), a3: P3 = instance(), a4: P4 = instance(), a5: P5 = instance(), a6: P6 = instance(), a7: P7 = instance(), a8: P8 = instance(), a9: P9 = instance(), a10: P10 = instance(), a11: P11 = instance(), a12: P12 = instance(), a13: P13 = instance(), a14: P14 = instance(), a15: P15 = instance(), a16: P16 = instance(), a17: P17 = instance(), a18: P18 = instance(), a19: P19 = instance(), a20: P20 = instance(), a21: P21 = instance(), a22: P22 = instance()): T

inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> T): T
inline fun <T, A : Any, P1, P2> DirectDIAware.new(param: A, constructor: (P1, P2) -> T): T
inline fun <T, A : Any, P1, P2, P3> DirectDIAware.new(param: A, constructor: (P1, P2, P3) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8) -> T): T
inline fun <T, A : Any, P1, P2, P3, P4, P5, P6, P7, P8, P9> DirectDIAware.new(param: A, constructor: (P1, P2, P3, P4, P5, P6, P7, P8, P9) -> T): T

Please see parent new function documentation for more info.

inline fun <T, A : Any> DirectDIAware.new(param: A, constructor: (A) -> T): T

This is a new factory function overload that takes a parameter param.

inline fun <T, P1> DirectDIAware.new(constructor: (P1) -> T, a1: P1 = instance()): T

Auto resolve a class dependencies by using its constructor reference. Allows defining specific arguments (all non-specified arguments are retrieved from the container). The resolution is done at compile time by leveraging inline functions, no reflection is required.

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 onErasedContext(): BindingDI<C>
Link copied to clipboard
abstract fun overriddenFactory(): (Any?) -> Any

Gets a factory from the overridden binding.

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

Gets a factory 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.