Skip to content

Empty

object Empty : SentierValues

The empty SentierValues instance.

Functions

fold

open override fun <T> fold(seed: T, action: (T, SentierValue<*>, Any?) -> T): T

Combines all the values into a single value.

This is useful to convert the data out of this data structure.

get

open operator override fun <T> get(value: SentierValue<T>): Nothing?

The empty instance contains no values, so accessing values always returns null.

toString

open override fun toString(): String

with

inline fun <T> SentierValues.with(spec: SentierValue<T>, value: () -> T): SentierValues

Appends a new value corresponding to spec.

If the same value is added multiple times, only the last value is kept.

Example

val values = SentierValues
    .with(Message) { "Create user" }
    .with(EventTime) { Clock.System.now() }