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 interfaceIDataStore.IDataStoreSupplierLike aSupplierfor aIDataStore, but with the correct type parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(K key)Check if the data store contains a value for the given key.Vget(K key)Get the value for the given key.voidput(K key, V value)Put a value for the given key.voidremove(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
nullotherwise.
-
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.
-
-