Package de.xima.fc.common.data
Interface IDataStore<K,V>
-
- Type Parameters:
K
- Type of the keys.V
- Type of the values.
public interface IDataStore<K,V>
Similar toMap
, but with a more limited set of operations. This interface is used to provide a view of a data store that is not necessarily a map. The data store may be a map, but it may also be a list, a set, or any other data structure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IDataStore.IDataStoreSupplier
Like aSupplier
for aIDataStore
, but with the correct type parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(K key)
Check if the data store contains a value for the given key.V
get(K key)
Get the value for the given key.void
put(K key, V value)
Put a value for the given key.void
remove(K key)
Remove the mapping for the given key.
-
-
-
Method Detail
-
contains
boolean contains(K key)
Check if the data store contains a value for the given key.- Parameters:
key
- The key.- Returns:
- True if the key is present.
-
get
V get(K key)
Get the value for the given key.- Parameters:
key
- The key.- Returns:
- The value, if it exists, or
null
otherwise.
-
put
void put(K key, V value)
Put a value for the given key.- Parameters:
key
- The key.value
- The value.
-
remove
void remove(K key)
Remove the mapping for the given key.- Parameters:
key
- The key.
-
-