beforeChange

Common
JVM
JS
Native
1.0
protected open fun beforeChange(
    property: KProperty<*>,
    oldValue: T,
    newValue: T
): Boolean

The callback which is called before a change to the property value is attempted. The value of the property hasn't been changed yet, when this callback is invoked. If the callback returns true the value of the property is being set to the new value, and if the callback returns false the new value is discarded and the property remains its old value.