Snapshot

data class Snapshot(val values: Map<String, Keystone.Entry>)

An immutable snapshot of key-value entries within a scope, emitted by observation flows.

Constructors

Link copied to clipboard
constructor(values: Map<String, Keystone.Entry>)

Properties

Link copied to clipboard

A map of key names to typed Entry values.

Functions

Link copied to clipboard

Checks whether the snapshot contains the given key.

Link copied to clipboard
fun getBoolean(key: String, defaultValue: Boolean = false): Boolean

Retrieves a Boolean value by key, falling back to defaultValue if missing.

Link copied to clipboard
fun getDouble(key: String, defaultValue: Double = 0.0): Double

Retrieves a Double value by key, falling back to defaultValue if missing.

Link copied to clipboard
fun getFloat(key: String, defaultValue: Float = 0.0f): Float

Retrieves a Float value by key, falling back to defaultValue if missing.

Link copied to clipboard
fun getInt(key: String, defaultValue: Int = 0): Int

Retrieves an Int value by key, falling back to defaultValue if missing.

Link copied to clipboard
fun getLong(key: String, defaultValue: Long = 0): Long

Retrieves a Long value by key, falling back to defaultValue if missing.

Link copied to clipboard
fun getString(key: String, defaultValue: String = ""): String

Retrieves a String value by key, falling back to defaultValue if missing.

Link copied to clipboard

Returns true if the snapshot contains no entries.

Link copied to clipboard
fun keys(): Set<String>

Returns the set of all keys in this snapshot.