public class ActorStateManager extends Object
Modifier and Type | Method and Description |
---|---|
<T> reactor.core.publisher.Mono<Void> |
add(String stateName,
T value)
Adds a given key/value to the Actor's state store's cache.
|
void |
clear()
Clears all changes not yet saved to state store.
|
reactor.core.publisher.Mono<Boolean> |
contains(String stateName)
Checks if a given state exists in state store or cache.
|
<T> reactor.core.publisher.Mono<T> |
get(String stateName,
Class<T> clazz)
Fetches the most recent value for the given state, including cached value.
|
reactor.core.publisher.Mono<Void> |
remove(String stateName)
Removes a given state from state store's cache.
|
reactor.core.publisher.Mono<Void> |
save()
Saves all changes to state store.
|
<T> reactor.core.publisher.Mono<Void> |
set(String stateName,
T value)
Updates a given key/value pair in the state store's cache.
|
public <T> reactor.core.publisher.Mono<Void> add(String stateName, T value)
T
- Type of the object being added.stateName
- Name of the state being added.value
- Value to be added.public <T> reactor.core.publisher.Mono<T> get(String stateName, Class<T> clazz)
T
- Type being fetched.stateName
- Name of the state.clazz
- Class type for the value being fetched.public <T> reactor.core.publisher.Mono<Void> set(String stateName, T value)
T
- Type of the value being set.stateName
- Name of the state being updated.value
- Value to be set for given state.public reactor.core.publisher.Mono<Void> remove(String stateName)
stateName
- State being stored.public reactor.core.publisher.Mono<Boolean> contains(String stateName)
stateName
- State being checked.public reactor.core.publisher.Mono<Void> save()
public void clear()
Copyright © 2020. All rights reserved.