INNER CODE UNIT · Kotlin

BaseDSL

kosi-libs/Kodein · kodein-di/src/commonMain/kotlin/org/kodein/di/Copy.kt:68

    public abstract class BaseDSL : SearchDSL(), Copy {
        internal val copySpecs = ArrayList<CopySpecs>()
        internal val ignoreSpecs = ArrayList<CopySpecs>()

        /**
         * Second half of the sentence `[copy|ignore] the` and `[copy|ignore] all`
         */
        public class Sentence(private val specs: MutableList<CopySpecs>) {
            /**
             * Defines that this spec will only correspond to **one** matching binding.
             *
             * @param binding The binding it should match.
             * @return The binding itself to configure it (e.g. `copy the binding<Whatever>() with context<MyContext>()`).
             */
            public infix fun the(binding: Binding): SearchSpecs {
                return CopySpecs(all = false).also { binding.apply(it) ; specs += it }
            }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…