public abstract class AbstractStateContext extends java.lang.Object implements StateContext
StateContext which uses a Map to store the
attributes.| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Object,java.lang.Object> |
attributes |
private State |
currentState |
| Constructor and Description |
|---|
AbstractStateContext() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getAttribute(java.lang.Object key)
Returns the value of the attribute with the specified key or
nullif not found. |
protected java.util.Map<java.lang.Object,java.lang.Object> |
getAttributes() |
State |
getCurrentState()
Returns the current
State. |
void |
setAttribute(java.lang.Object key,
java.lang.Object value)
Sets the value of the attribute with the specified key.
|
void |
setCurrentState(State state)
Sets the current
State. |
java.lang.String |
toString() |
private State currentState
private java.util.Map<java.lang.Object,java.lang.Object> attributes
public java.lang.Object getAttribute(java.lang.Object key)
StateContextnullif not found.getAttribute in interface StateContextkey - the key.null.public State getCurrentState()
StateContextState. This is only meant for internal use.getCurrentState in interface StateContextState.public void setAttribute(java.lang.Object key,
java.lang.Object value)
StateContextsetAttribute in interface StateContextkey - the key.value - the value.public void setCurrentState(State state)
StateContextState. This is only meant for internal use.
Don't call it directly!setCurrentState in interface StateContextstate - the new current State.protected java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
public java.lang.String toString()
toString in class java.lang.Object