Constructor and Description |
---|
MemoryPersisterImpl() |
MemoryPersisterImpl(Collection<State<T>> states,
State<T> startState) |
MemoryPersisterImpl(List<State<T>> states,
State<T> startState,
String stateFieldName) |
MemoryPersisterImpl(T stateful,
List<State<T>> states,
State<T> startState) |
MemoryPersisterImpl(T stateful,
List<State<T>> states,
State<T> startState,
String stateFieldName) |
Modifier and Type | Method and Description |
---|---|
State<T> |
addState(State<T> state) |
State<T> |
getCurrent(T stateful)
Returns the current state.
|
State<T> |
getStartState() |
String |
getStateFieldName() |
Collection<State<T>> |
getStates() |
State<T> |
removeState(State<T> state) |
State<T> |
removeState(String name) |
void |
setCurrent(T stateful,
State<T> current) |
void |
setCurrent(T stateful,
State<T> current,
State<T> next)
Set the current state to the next state.
|
void |
setStartState(State<T> startState)
Set the Start State
|
void |
setStates(Collection<State<T>> states)
Set the Collection of States to be managed by the Persister
|
public MemoryPersisterImpl()
public MemoryPersisterImpl(Collection<State<T>> states, State<T> startState)
public MemoryPersisterImpl(List<State<T>> states, State<T> startState, String stateFieldName)
public MemoryPersisterImpl(T stateful, List<State<T>> states, State<T> startState)
public Collection<State<T>> getStates()
public void setStates(Collection<State<T>> states)
Persister
public void setStartState(State<T> startState)
Persister
setStartState
in interface Persister<T>
startState
- Start Statepublic String getStateFieldName()
public State<T> getCurrent(T stateful)
Persister
getCurrent
in interface Persister<T>
stateful
- Stateful Entitypublic void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException
Persister
setCurrent
in interface Persister<T>
stateful
- StatefulEntitycurrent
- Expected current State of the Stateful Entitynext
- The value of the updated StateStaleStateException
- thrown if the state value of the Stateful Entity is not equal to the passed in current
valueCopyright © 2016. All rights reserved.