get

@ApiStatus.Experimental
abstract suspend fun <T : Any> get(key: StateKey<T>): T?

Gets the state stored under key, deserializing the raw value using the StateKey.serdeInfo.

Return

the value containing the stored state deserialized, or null if not set.

Parameters

key

identifying the state to get and its type.

Throws

when the state cannot be deserialized.