SlotCapture

Capture that stores only the last value.

Types

Link copied to clipboard
sealed interface Value<out T>

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val value: SlotCapture.Value<T>

If no captured values it returns Value.Absent. Otherwise, it returns the last captured value wrapped with Value.Present

Link copied to clipboard
abstract override val values: List<T>

Contains only latest value.

Functions

Link copied to clipboard
abstract fun capture(value: T)
Link copied to clipboard
fun <T> SlotCapture<T>.get(): T

Returns unwrapped SlotCapture.value if it is SlotCapture.Value.Present. Otherwise, it fails.

Link copied to clipboard

Returns unwrapped SlotCapture.value if it is SlotCapture.Value.Present. Otherwise, it returns null.

Link copied to clipboard
operator fun <T> SlotCapture<T>.getValue(thisRef: Any?, property: KProperty<*>): T?

Just like getIfPresent, but as a getValue operator.