Refactor script infrastructure for easier usage and testability:

- add script annotation for specifying default configuration for a script
- add support for this annotation in the default configurator
- rename configurator accordingly
- add default implementation of the refineConfiguration method
- make property bag class open
This commit is contained in:
Ilya Chernikov
2018-04-25 11:28:33 +02:00
parent 516924cda1
commit 57db77a295
5 changed files with 32 additions and 18 deletions
@@ -17,7 +17,7 @@ class TypedKeyDelegate<T> {
fun <T> typedKey() = TypedKeyDelegate<T>()
class ChainedPropertyBag private constructor(private val parent: ChainedPropertyBag?, private val data: Map<TypedKey<*>, Any?>) {
open class ChainedPropertyBag private constructor(private val parent: ChainedPropertyBag?, private val data: Map<TypedKey<*>, Any?>) {
constructor(parent: ChainedPropertyBag? = null, pairs: Iterable<Pair<TypedKey<*>, Any?>>) :
this(parent, HashMap<TypedKey<*>, Any?>().also { it.putAll(pairs) })