Fix equality and serializability of scripting data, fix relevant caching behaviour

This commit is contained in:
Ilya Chernikov
2019-03-14 12:00:04 +01:00
parent 7a4d369c9f
commit 931b1c66d8
6 changed files with 52 additions and 5 deletions
@@ -48,6 +48,11 @@ open class PropertiesCollection(private val properties: Map<Key<*>, Any?> = empt
fun entries(): Set<Map.Entry<Key<*>, Any?>> = properties.entries
override fun equals(other: Any?): Boolean =
(other as? PropertiesCollection)?.let { it.properties == properties } == true
override fun hashCode(): Int = properties.hashCode()
companion object {
fun <T> key(defaultValue: T? = null) = PropertyKeyDelegate(defaultValue)
fun <T> keyCopy(source: Key<T>) = PropertyKeyCopyDelegate(source)