Class AbstractStateContext
- java.lang.Object
-
- org.apache.mina.statemachine.context.AbstractStateContext
-
- All Implemented Interfaces:
StateContext
- Direct Known Subclasses:
DefaultStateContext
public abstract class AbstractStateContext extends Object implements StateContext
AbstractStateContext
which uses aMap
to store the attributes.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description AbstractStateContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAttribute(Object key)
Returns the value of the attribute with the specified key ornull
if not found.protected Map<Object,Object>
getAttributes()
State
getCurrentState()
void
setAttribute(Object key, Object value)
Sets the value of the attribute with the specified key.void
setCurrentState(State state)
Sets the currentState
.String
toString()
-
-
-
Method Detail
-
getAttribute
public Object getAttribute(Object key)
Returns the value of the attribute with the specified key ornull
if not found.- Specified by:
getAttribute
in interfaceStateContext
- Parameters:
key
- the key.- Returns:
- the value or
null
.
-
getCurrentState
public State getCurrentState()
- Specified by:
getCurrentState
in interfaceStateContext
- Returns:
- the current
State
. This is only meant for internal use.
-
setAttribute
public void setAttribute(Object key, Object value)
Sets the value of the attribute with the specified key.- Specified by:
setAttribute
in interfaceStateContext
- Parameters:
key
- the key.value
- the value.
-
setCurrentState
public void setCurrentState(State state)
Sets the currentState
. This is only meant for internal use. Don't call it directly!- Specified by:
setCurrentState
in interfaceStateContext
- Parameters:
state
- the new currentState
.
-
-