Builder

interface Builder

This is where you configure the bindings.

Parameters

allowOverride

Whether or not the bindings defined by this builder or its imports are allowed to explicitly override existing bindings.

silentOverride

Whether or not the bindings defined by this builder or its imports are allowed to silently override existing bindings.

bindingsMap

The map that contains the bindings. Can be set at construction to construct a sub-builder (with different override permissions).

Functions

bind
Link copied to clipboard
common
abstract fun <C : Any, A, T : Any> bind(key: DI.Key<C, A, T>, binding: DIBinding<in C, in A, out T>, fromModule: String? = null, overrides: Boolean? = null)
Binds the given key to the given binding.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
extend
Link copied to clipboard
common
abstract fun extend(container: DIContainer, allowOverride: Boolean = false, copy: Set<DI.Key<*, *, *>> = emptySet())
Imports all bindings defined in the given DIContainer into this builder.
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
onReady
Link copied to clipboard
common
abstract fun onReady(cb: DirectDI.() -> Unit)
Adds a callback that will be called once the DI object has been initialized.
registerContextTranslator
Link copied to clipboard
common
abstract fun registerContextTranslator(translator: ContextTranslator<*, *>)
subBuilder
Link copied to clipboard
common
abstract fun subBuilder(allowOverride: Boolean = false, silentOverride: Boolean = false): DIContainer.Builder
Creates a sub builder that will register its bindings to the same map.
toString
Link copied to clipboard
common
open fun toString(): String