Interface StateRepository<K,​V>

  • Type Parameters:
    K - Key type
    V - Value type
    All Superinterfaces:
    AutoCloseable, Service

    public interface StateRepository<K,​V>
    extends Service
    This StateRepository holds a set of key/value pairs for defining a particular state of a component. For instance it can be a set of indexes.

    An IdempotentRepository behaves more or less like a Set whereas this StateRepository behaves like a Map.

    • Method Detail

      • setState

        void setState​(K key,
                      V value)
        Sets the state value for the given key.
        Parameters:
        key - State key
        value - State value
      • getState

        V getState​(K key)
        Gets the state value for the given key. It returns null if the key is unknown.
        Parameters:
        key - State key
        Returns:
        State value or null the key is unknown