All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.salomonbrys.kodein.GKodeinBuilder.kt Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
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