Property

abstract class Property<T> : BaseObservable<T> , GetSetter<T> (source)

A property is a variable which is modifiable and can have those mutations observed. When serializing a property to Json you can use PropertyTypeAdapterFactory to automatically serialize the stored value in place, instead of wrapping the value in a dictionary.

Whenever a config option calls for a field with type T, then a Property<T> will also work.

Parameters

<T>

the type of value this Property can hold.

Functions

Link copied to clipboard
open fun notifyObservers()
Explicitly notify observers about state changes that are internal to the stored value.
Link copied to clipboard
open fun <T> of(value: T): Property<T>
Create a Property with a given initial value.
Link copied to clipboard
open fun <T> upgrade(getSetter: GetSetter<T>): Property<T>
Upgrades a GetSetter so that access through the returned Property will notify observers, with state still managed in the old GetSetter.
Link copied to clipboard
open fun <T> wrap(getSetter: GetSetter<T>): Property<T>
Upgrades a GetSetter so that access through the returned Property will notify observers, with state still managed in the old GetSetter.