Package dev.restate.sdk
Interface Restate.State
- Enclosing class:
Restate
@Experimental
public static interface Restate.State
EXPERIMENTAL API: Interface to interact with this Virtual Object/Workflow state.
-
Method Summary
Modifier and TypeMethodDescriptionvoidEXPERIMENTAL API: Clears the state stored under key.voidclearAll()EXPERIMENTAL API: Clears all the state of this virtual object instance key-value state storage<T> Optional<T> EXPERIMENTAL API: Gets all the known state keys for this virtual object instance.<T> void
-
Method Details
-
get
EXPERIMENTAL API: Gets the state stored under key, deserializing the raw value using theSerdein theStateKey.- Parameters:
key- identifying the state to get and its type.- Returns:
- an
Optionalcontaining the stored state deserialized or an emptyOptionalif not set yet. - Throws:
RuntimeException- when the state cannot be deserialized.
-
set
EXPERIMENTAL API: Sets the given value under the given key, serializing the value using theSerdein theStateKey.- Parameters:
key- identifying the value to store and its type.value- to store under the given key. MUST NOT be null.- Throws:
IllegalStateException- if called from a Shared handler
-
clear
EXPERIMENTAL API: Clears the state stored under key.- Parameters:
key- identifying the state to clear.- Throws:
IllegalStateException- if called from a Shared handler
-
getAllKeys
EXPERIMENTAL API: Gets all the known state keys for this virtual object instance.- Returns:
- the immutable collection of known state keys.
-
clearAll
@Experimental void clearAll()EXPERIMENTAL API: Clears all the state of this virtual object instance key-value state storage- Throws:
IllegalStateException- if called from a Shared handler
-