getValue

inline fun <T> getValue(key: String): T?

Retrieves a typed value from the execution state.

This method provides type-safe access to values stored in the execution state map. It uses reified generics to ensure type safety at runtime.

Return

The value cast to type T, or null if the key doesn't exist or type doesn't match

Example:

// Store a value
state["userCount"] = 42

// Retrieve with type safety
val count: Int? = getValue<Int>("userCount") // Returns 42
val invalidType: String? = getValue<String>("userCount") // Returns null

Parameters

T

The expected type of the value

key

The state key to retrieve