Interface ReadWriteSetStore<K,​V>

  • Type Parameters:
    K - Key to use for gathering information.
    V - Value to fetch, that is a generic method.
    All Superinterfaces:
    ReadOnlyStore<K,​V>
    All Known Subinterfaces:
    MessageSetStore<K,​M,​F>
    All Known Implementing Classes:
    DirectoryMessageSetStore, InMemoryMessageSetStore

    public interface ReadWriteSetStore<K,​V>
    extends ReadOnlyStore<K,​V>
    Interface for a store that acts as a set of unique values with a natural key per item. Note that it is only the setter methods that differs from a normal read-write map store.
    • Method Detail

      • putAll

        @Nonnull
        java.util.Map<K,​V> putAll​(@Nonnull
                                        java.util.Collection<V> values)
        Parameters:
        values - Put all key value pairs form this map into the storage.
        Returns:
        Immutable map of replaced values, if any.
      • removeAll

        @Nonnull
        java.util.Map<K,​V> removeAll​(java.util.Collection<K> keys)
        Remove the values for the given keys.
        Parameters:
        keys - Map of removed key value pairs.
        Returns:
        Immutable map of removed values. Values not removed should not have an entry in the result set (no null entries).
      • put

        @Nullable
        default V put​(@Nonnull
                      V value)
        Parameters:
        value - The value to add.
        Returns:
        Replaced value if any, otherwise null.
      • remove

        @Nullable
        default V remove​(@Nonnull
                         K key)
        Remove the key value pair from the store.
        Parameters:
        key - The key to remove.
        Returns:
        The value removed if any, otherwise null.