Package net.morimekta.providence.storage
Interface ReadWriteStore<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:
MessageListStore<K,M,F>
,MessageStore<K,M,F>
- All Known Implementing Classes:
DirectoryMessageListStore
,DirectoryMessageStore
,InMemoryMessageListStore
,InMemoryMessageStore
public interface ReadWriteStore<K,V> extends ReadOnlyStore<K,V>
Interface to read and write a value or a range of values for a given key or keys.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default V
put(K key, V value)
java.util.Map<K,V>
putAll(java.util.Map<K,V> values)
default V
remove(K key)
Remove the key value pair from the store.java.util.Map<K,V>
removeAll(java.util.Collection<K> keys)
Remove the values for the given keys.-
Methods inherited from interface net.morimekta.providence.storage.ReadOnlyStore
containsKey, get, getAll, keys
-
-
-
-
Method Detail
-
putAll
@Nonnull java.util.Map<K,V> putAll(@Nonnull java.util.Map<K,V> values)
- Parameters:
values
- Put all key value pairs form this map into the storage.- Returns:
- Immutable map of replaced values. Values not already present should not have an entry in the result map (no key -> null mapping).
-
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 key value pairs. Values not removed should not have an entry in the result map (no key -> null mapping).
-
put
@Nullable default V put(@Nonnull K key, @Nonnull V value)
- Parameters:
key
- The key to put message at.value
- The value to put.- Returns:
- Replaced value if any, otherwise null.
-
-