Add generic properties builder dsl, convert maven example to it

This commit is contained in:
Ilya Chernikov
2018-07-17 10:06:14 +02:00
parent d0ed86c11c
commit 7a621405ae
10 changed files with 158 additions and 19 deletions
@@ -17,7 +17,7 @@ class TypedKeyDelegate<T>(val defaultValue: T? = null) {
fun <T> typedKey(defaultValue: T? = null) = TypedKeyDelegate(defaultValue)
open class ChainedPropertyBag private constructor(private val parent: ChainedPropertyBag?, private val data: Map<TypedKey<*>, Any?>) {
open class ChainedPropertyBag internal constructor(private val parent: ChainedPropertyBag?, internal val data: Map<TypedKey<*>, Any?>) {
constructor(parent: ChainedPropertyBag? = null, pairs: Iterable<Pair<TypedKey<*>, Any?>>) :
this(parent, HashMap<TypedKey<*>, Any?>().also { it.putAll(pairs) })