Class AbstractStateContext
- java.lang.Object
-
- org.apache.mina.statemachine.context.AbstractStateContext
-
- All Implemented Interfaces:
StateContext
- Direct Known Subclasses:
DefaultStateContext
public abstract class AbstractStateContext extends java.lang.Object implements StateContext
AbstractStateContextwhich uses aMapto store the attributes.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Object,java.lang.Object>attributesprivate StatecurrentState
-
Constructor Summary
Constructors Constructor Description AbstractStateContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(java.lang.Object key)Returns the value of the attribute with the specified key ornullif not found.protected java.util.Map<java.lang.Object,java.lang.Object>getAttributes()StategetCurrentState()voidsetAttribute(java.lang.Object key, java.lang.Object value)Sets the value of the attribute with the specified key.voidsetCurrentState(State state)Sets the currentState.java.lang.StringtoString()
-
-
-
Field Detail
-
currentState
private State currentState
-
attributes
private java.util.Map<java.lang.Object,java.lang.Object> attributes
-
-
Method Detail
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object key)
Returns the value of the attribute with the specified key ornullif not found.- Specified by:
getAttributein interfaceStateContext- Parameters:
key- the key.- Returns:
- the value or
null.
-
getCurrentState
public State getCurrentState()
- Specified by:
getCurrentStatein interfaceStateContext- Returns:
- the current
State. This is only meant for internal use.
-
setAttribute
public void setAttribute(java.lang.Object key, java.lang.Object value)Sets the value of the attribute with the specified key.- Specified by:
setAttributein 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:
setCurrentStatein interfaceStateContext- Parameters:
state- the new currentState.
-
getAttributes
protected java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-