org.apache.mina.statemachine.context

## 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.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractStateContext()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getAttribute(Object key)` Returns the value of the attribute with the specified key or `null`if not found.
    `protected Map<Object,Object>` | `getAttributes()`
    `State` | `getCurrentState()` Returns the current `State`.
    `void` | `setAttribute(Object key, Object value)` Sets the value of the attribute with the specified key.
    `void` | `setCurrentState(State state)` Sets the current `State`.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractStateContext

          public AbstractStateContext()

  - ### Method Detail

    - #### getAttribute

          public Object getAttribute(Object key)

      Description copied from interface: `StateContext`
      Returns the value of the attribute with the specified key or `null`if not found.
      Specified by:
        `getAttribute` in interface `StateContext`
      Parameters:
        `key` - the key.
      Returns:
        the value or `null`.

    - #### getCurrentState

          public State getCurrentState()

      Description copied from interface: `StateContext`
      Returns the current `State`. This is only meant for internal use.
      Specified by:
        `getCurrentState` in interface `StateContext`
      Returns:
        the current `State`.

    - #### setAttribute

          public void setAttribute(Object key,
                          Object value)

      Description copied from interface: `StateContext`
      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)

      Description copied from interface: `StateContext`
      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`

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.