Package net.morimekta.providence.storage
Interface ReadOnlyStore<K,V>
-
- Type Parameters:
K- Key to use for gathering information.V- Value to fetch, that is a generic method.
- All Known Subinterfaces:
MessageListReadOnlyStore<K,M>,MessageListStore<K,M>,MessageReadOnlyStore<K,M>,MessageSetStore<K,M>,MessageStore<K,M>,ReadWriteSetStore<K,V>,ReadWriteStore<K,V>
- All Known Implementing Classes:
DirectoryMessageListStore,DirectoryMessageSetStore,DirectoryMessageStore,InMemoryMessageListStore,InMemoryMessageSetStore,InMemoryMessageStore,InMemorySetStore,InMemoryStore
public interface ReadOnlyStore<K,V>Interface to read 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 booleancontainsKey(K key)default Vget(K key)Get a single value from the storage.java.util.Map<K,V>getAll(java.util.Collection<K> keys)Look up a set of keys from the storage.java.util.Collection<K>keys()Get a collection of all the keys in the store.default intsize()
-
-
-
Method Detail
-
getAll
@Nonnull java.util.Map<K,V> getAll(@Nonnull java.util.Collection<K> keys)
Look up a set of keys from the storage.- Parameters:
keys- The keys to look up.- Returns:
- Map of all the found key value pairs. Values not found should not have an entry in the result map (no key -> null mapping).
-
containsKey
boolean containsKey(@Nonnull K key)- Parameters:
key- The key to look up.- Returns:
- True if the key was contained in the map.
-
keys
@Nonnull java.util.Collection<K> keys()
Get a collection of all the keys in the store.- Returns:
- Key collection.
-
get
@Nullable default V get(@Nonnull K key)
Get a single value from the storage.- Parameters:
key- The key to look up.- Returns:
- The value if present.
-
size
default int size()
- Returns:
- Get the total number of entries in the store, same as the number of unique keys.
-
-