Interface Restate.State
- Enclosing class:
Restate
public static interface Restate.State
Interface to interact with this Virtual Object/Workflow state.
-
Method Details
-
get
- 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
- 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
Clears the state stored under key.- Parameters:
key- identifying the state to clear.- Throws:
IllegalStateException- if called from a Shared handler
-
getAllKeys
Collection<String> getAllKeys()Gets all the known state keys for this virtual object instance.- Returns:
- the immutable collection of known state keys.
-
clearAll
void clearAll()Clears all the state of this virtual object instance key-value state storage- Throws:
IllegalStateException- if called from a Shared handler
-