aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/model/properties/PropertyContainer.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/kotlin/model/properties/PropertyContainer.kt b/core/src/main/kotlin/model/properties/PropertyContainer.kt
index 162f1bc8..d217ceee 100644
--- a/core/src/main/kotlin/model/properties/PropertyContainer.kt
+++ b/core/src/main/kotlin/model/properties/PropertyContainer.kt
@@ -16,6 +16,9 @@ data class PropertyContainer<C : Any> internal constructor(
fun <D : C> addAll(extras: Collection<ExtraProperty<D>>): PropertyContainer<D> =
PropertyContainer(map + extras.map { p -> p.key to p })
+ operator fun <D : C> minus(prop: ExtraProperty.Key<C, *>): PropertyContainer<D> =
+ PropertyContainer(map.filterNot { it.key == prop })
+
companion object {
fun <T : Any> empty(): PropertyContainer<T> = PropertyContainer(emptyMap())
fun <T : Any> withAll(vararg extras: ExtraProperty<T>?) = empty<T>().addAll(extras.filterNotNull())