Class StateLogger

    • Constructor Summary

      Constructors 
      Constructor Description
      StateLogger​(MutableStateObj state, java.util.function.Consumer<java.lang.String> listener)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> getState()  
      boolean hasState​(StateObj statex)  
      boolean hasState​(java.lang.String key, java.lang.String value)  
      java.lang.String toString()  
      boolean updateState​(StateObj values)
      Add the state to this state
      boolean updateState​(java.lang.String key, java.lang.String value)
      Add the state to this state
      boolean updateState​(java.util.Map<java.lang.String,​java.lang.String> values)
      Add the state to this state
      • Methods inherited from class java.lang.Object

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

      • StateLogger

        public StateLogger​(MutableStateObj state,
                           java.util.function.Consumer<java.lang.String> listener)
    • Method Detail

      • getState

        public java.util.Map<java.lang.String,​java.lang.String> getState()
        Specified by:
        getState in interface StateObj
        Returns:
        current state
      • updateState

        public boolean updateState​(StateObj values)
        Description copied from interface: MutableStateObj
        Add the state to this state
        Specified by:
        updateState in interface MutableStateObj
        Parameters:
        values - state
        Returns:
        true if this state was changed, false otherwise
      • updateState

        public boolean updateState​(java.util.Map<java.lang.String,​java.lang.String> values)
        Description copied from interface: MutableStateObj
        Add the state to this state
        Specified by:
        updateState in interface MutableStateObj
        Parameters:
        values - state
        Returns:
        true if this state was changed, false otherwise
      • updateState

        public boolean updateState​(java.lang.String key,
                                   java.lang.String value)
        Description copied from interface: MutableStateObj
        Add the state to this state
        Specified by:
        updateState in interface MutableStateObj
        Parameters:
        key - key
        value - value
        Returns:
        true if this state was changed, false otherwise
      • hasState

        public boolean hasState​(java.lang.String key,
                                java.lang.String value)
        Specified by:
        hasState in interface StateObj
        Parameters:
        key - key
        value - vaue
        Returns:
        true if the state contains the exact key and value specified
      • hasState

        public boolean hasState​(StateObj statex)
        Specified by:
        hasState in interface StateObj
        Parameters:
        statex - test state
        Returns:
        true if the state contains all of the key/value state specified
      • toString

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