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

main.DynamicOverrides.kt Maven / Gradle / Ivy

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