ObservableProperty

abstract class ObservableProperty<V>(initialValue: V) : ReadWriteProperty<Any?, V> (source)

Implements the core logic of a property delegate for a read/write property that calls callback functions when changed.

Since Kotlin

1.1

Parameters

initialValue

the initial value of the property.

abstract class ObservableProperty<V>(initialValue: V) : ReadWriteProperty<Any?, V> (source)

Implements the core logic of a property delegate for a read/write property that calls callback functions when changed.

Since Kotlin

1.0

Parameters

initialValue

the initial value of the property.

Constructors

Link copied to clipboard
constructor(initialValue: V)
constructor(initialValue: V)

Functions

Link copied to clipboard
protected open fun afterChange(property: KProperty<*>, oldValue: V, newValue: V)

The callback which is called after the change of the property is made. The value of the property has already been changed when this callback is invoked.

Since Kotlin 1.1
protected open fun afterChange(property: KProperty<*>, oldValue: V, newValue: V)

The callback which is called after the change of the property is made. The value of the property has already been changed when this callback is invoked.

Since Kotlin 1.0
Link copied to clipboard
protected open fun beforeChange(property: KProperty<*>, oldValue: V, newValue: V): 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.

Since Kotlin 1.1
protected open fun beforeChange(property: KProperty<*>, oldValue: V, newValue: V): 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.

Since Kotlin 1.0
Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): V

Returns the value of the property for the given object.

Since Kotlin 1.1
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): V

Returns the value of the property for the given object.

Since Kotlin 1.0
Link copied to clipboard
open operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: V)

Sets the value of the property for the given object.

Since Kotlin 1.1
open operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: V)

Sets the value of the property for the given object.

Since Kotlin 1.0