Class AbstractStateContext

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Object,​java.lang.Object> attributes  
      private State currentState  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()
      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()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • currentState

        private State currentState
      • attributes

        private java.util.Map<java.lang.Object,​java.lang.Object> attributes
    • Constructor Detail

      • AbstractStateContext

        public AbstractStateContext()
    • Method Detail

      • getAttribute

        public java.lang.Object getAttribute​(java.lang.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.
      • setAttribute

        public void setAttribute​(java.lang.Object key,
                                 java.lang.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 java.util.Map<java.lang.Object,​java.lang.Object> getAttributes()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object