Class State

  • All Implemented Interfaces:
    java.io.Serializable


    public class State
    extends java.lang.Object
    implements java.io.Serializable
    An implementation of state that's used in a SuasStore.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      State()
      Create a new and empty state.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o) 
      <E> E getState(java.lang.Class<E> clazz)
      Get a state for a Class
      java.lang.Object getState(java.lang.String stateKey)
      Get a state for a state key
      <E> E getState(java.lang.String stateKey, java.lang.Class<E> clazz)
      Get a state for the a state key of the type <E>
      int hashCode() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • State

        public State()
        Create a new and empty state.
    • Method Detail

      • getState

        public java.lang.Object getState(java.lang.String stateKey)
        Get a state for a state key
        Parameters:
        stateKey - state key
        Returns:
        not typed state
      • getState

        public <E> E getState(java.lang.Class<E> clazz)
        Get a state for a Class

        If available in the state returns a the state with type <E>

        Parameters:
        clazz - type of the state
        Returns:
        the state with the correct type or null
      • getState

        public <E> E getState(java.lang.String stateKey,
                              java.lang.Class<E> clazz)
        Get a state for the a state key of the type <E>

        If available in the state returns a the state with type <E>

        Parameters:
        stateKey - key for the state
        clazz - type of the state
        Returns:
        the state with the correct type or null
      • toString

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

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object