
com.github.salomonbrys.kodein.GKodeinBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kodein Show documentation
Show all versions of kodein Show documentation
Kotlin Dependency Injection
package com.github.salomonbrys.kodein
/**
* Starts the binding of a given type with a given tag.
*
* T generics will be kept.
*
* @param T The type to bind.
* @param tag The tag to bind.
* @param overrides Whether this bind **must**, **may** or **must not** override an existing binding.
* @return The binder: call [Kodein.Builder.TBuilder.TypeBinder.with]) on it to finish the binding syntax and register the binding.
*/
inline fun Kodein.Builder.bind(tag: Any? = null, overrides: Boolean? = null) = Bind(generic(), tag, overrides)
/**
* Binds the previously given tag to the given instance.
*
* T generics will be kept.
*
* @param T The type of value to bind.
* @param value The instance to bind.
*/
infix inline fun Kodein.Builder.ConstantBinder.with(value: T) = With(generic(), value)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy