WriteOnceProperty

class WriteOnceProperty<T : Any> : IOptProperty<T>

Constructors

Link copied to clipboard
fun WriteOnceProperty()

Functions

Link copied to clipboard
open override fun advise(lifetime: Lifetime, handler: (T) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called, receiving an instance of the event. The subscription is removed when the given lifetime expires.

Link copied to clipboard
open override fun set(newValue: T)

Sets the property to the given value.

Link copied to clipboard
fun setIfEmpty(newValue: T): Boolean
Link copied to clipboard
open override fun view(lifetime: Lifetime, handler: (Lifetime, T) -> Unit)

Adds a subscription to changes of the contents of the object.

Properties

Link copied to clipboard
open override val change: ISource<T>
Link copied to clipboard
open val changing: Boolean
Link copied to clipboard
open override val valueOrNull: T?

Returns the current value of the property, or null if the property has not been initialized.