Class DefaultKeyValueStateRepository<T>

    • Constructor Detail

      • DefaultKeyValueStateRepository

        public DefaultKeyValueStateRepository​(KeyValueTable table,
                                              Class<T> clazz)
        Creates a new DefaultKeyValueStateRepository, using the provided table for data storage.
        Parameters:
        table - key-value table used for data storage
        clazz - class representing state values stored in this repository
    • Method Detail

      • fetch

        public T fetch​(String key)
        Description copied from interface: KeyValueStateRepository
        Fetches the state value stored under the provided key in this repository.
        Specified by:
        fetch in interface KeyValueStateRepository<T>
        Parameters:
        key - key associated with the state value
        Returns:
        object stored under the provided key in this repository
      • update

        public void update​(String key,
                           T value)
        Description copied from interface: KeyValueStateRepository
        Updates the provided state value, stored under the provided key, in this repository.

        If no value is currently stored under the provided key - it will be inserted into this repository.

        Specified by:
        update in interface KeyValueStateRepository<T>
        Parameters:
        key - key associated with the state value
        value - state value