Direct

class Direct<T>(val value: T) : DeferredValue<T>

A DeferredValue that is directly initialized with a value. Generates a new sequence number when created.

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard
open override val seqNo: Long

The sequence number of this DeferredValue. The sequence number defines the "age" of the value, where a lower sequence number indicates an older value. Sequence numbers are unique for each DeferredValue chain, but are the same for all DeferredValues that are derived from the same source. Use nextSeqNo to generate a new unique sequence number.

Link copied to clipboard
open override val value: T

The possibly lazily initialized value of this DeferredValue. Retrieving this value will initialize it if it hasn't been initialized yet. Once initialized, the value will not change.

Functions

Link copied to clipboard
open operator override fun compareTo(other: DeferredValue<*>): Int

Compares this DeferredValue with another DeferredValue based on their seqNo. Equivalent to seqNo.compareTo(other.seqNo).