Add a handler for providing evaluation context for scripts
use it on refinement. also some refactoring on context class and around
This commit is contained in:
+3
-1
@@ -13,7 +13,7 @@ import kotlin.reflect.KProperty
|
||||
import kotlin.reflect.KType
|
||||
import kotlin.script.experimental.api.KotlinType
|
||||
|
||||
open class PropertiesCollection(private var properties: Map<Key<*>, Any?> = emptyMap()) : Serializable {
|
||||
open class PropertiesCollection(protected var properties: Map<Key<*>, Any?> = emptyMap()) : Serializable {
|
||||
|
||||
open class Key<T>(
|
||||
val name: String,
|
||||
@@ -64,6 +64,8 @@ open class PropertiesCollection(private var properties: Map<Key<*>, Any?> = empt
|
||||
|
||||
val notTransientData: Map<Key<*>, Any?> get() = properties.filterKeys { it !is TransientKey<*>}
|
||||
|
||||
fun isEmpty(): Boolean = properties.isEmpty()
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
(other as? PropertiesCollection)?.let { it.properties == properties } == true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user