Override toString function in stdlib delegates

Co-authored-by: ilya-g <ilya.gorbunov@jetbrains.com>
This commit is contained in:
Iaroslav Postovalov
2021-01-02 18:51:37 +07:00
committed by Space Team
parent cfa06dbf74
commit fb80c0cb0d
7 changed files with 22 additions and 3 deletions
@@ -65,5 +65,8 @@ private class NotNullVar<T : Any>() : ReadWriteProperty<Any?, T> {
public override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
this.value = value
}
public override fun toString(): String =
"NotNullProperty(${if (value != null) "value=$value" else "value not initialized yet"})"
}
@@ -40,4 +40,6 @@ public abstract class ObservableProperty<V>(initialValue: V) : ReadWriteProperty
this.value = value
afterChange(property, oldValue, value)
}
override fun toString(): String = "ObservableProperty(value=$value)"
}