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
Abstract StateContext which uses a Map to store the attributes.
  • Field Details

  • Constructor Details

    • AbstractStateContext

      public AbstractStateContext()
  • Method Details

    • getAttribute

      public Object getAttribute(Object key)
      Returns the value of the attribute with the specified key or nullif not found.
      Specified by:
      getAttribute in interface StateContext
      Parameters:
      key - the key.
      Returns:
      the value or null.
    • getCurrentState

      public State getCurrentState()
      Specified by:
      getCurrentState in interface StateContext
      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 interface StateContext
      Parameters:
      key - the key.
      value - the value.
    • setCurrentState

      public void setCurrentState(State state)
      Sets the current State. This is only meant for internal use. Don't call it directly!
      Specified by:
      setCurrentState in interface StateContext
      Parameters:
      state - the new current State.
    • getAttributes

      protected Map<Object,Object> getAttributes()
    • toString

      public String toString()
      Overrides:
      toString in class Object