main.DynamicOverrides.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kontainer Show documentation
Show all versions of kontainer Show documentation
"Kotlin Depdency Injection Framework"
package de.peekandpoke.ultra.kontainer
import kotlin.reflect.KClass
class DynamicOverrides internal constructor(
val overrides: Map, () -> Any>
) {
class Builder {
private val overrides = mutableMapOf, () -> Any>()
internal fun build() = DynamicOverrides(overrides)
inline fun with(noinline instance: () -> SRV) {
with(SRV::class, instance)
}
fun with(srv: KClass, instance: () -> IMPL) {
overrides[srv] = instance
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy