Class DataStructure
java.lang.Object
expert.os.integration.microstream.DataStructure
The data structure used at Microstream on both
Template and any DataRepository
implementation.
It is a wrapper of LazyHashMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all entities from this structure .boolean<K,V> Optional<V> get(K key) * Returns the value to which the specified key is mapped, orOptional#empty()if this map contains no mapping for the key.inthashCode()booleanisEmpty()Returnstrueif this map contains no key-value mappings.<K,V> void put(K key, V value) Associates the specified value with the specified key in this map.<K> voidremove(K key) Removes the mapping for a key from this map if it is presentintsize()Returns the number of key-value mappings in this map.toString()<V> Stream<V>values()Returns aCollectionview of the values contained in this map.
-
Constructor Details
-
DataStructure
public DataStructure()
-
-
Method Details
-
put
public <K,V> void put(K key, V value) Associates the specified value with the specified key in this map.- Type Parameters:
K- the key typeV- the entity type- Parameters:
key- the keyvalue- the entity
-
get
* Returns the value to which the specified key is mapped, orOptional#empty()if this map contains no mapping for the key.- Type Parameters:
K- the key typeV- the entity type- Parameters:
key- the key or ID- Returns:
- the entity of
Optional.empty()
-
remove
public <K> void remove(K key) Removes the mapping for a key from this map if it is present- Type Parameters:
K- the key type- Parameters:
key- the key
-
size
public int size()Returns the number of key-value mappings in this map.- Returns:
- the number of key-value mappings in this map
-
isEmpty
public boolean isEmpty()Returnstrueif this map contains no key-value mappings.- Returns:
trueif this map contains no key-value mappings
-
values
Returns aCollectionview of the values contained in this map.- Type Parameters:
V- the entity type- Returns:
- a collection view of the values contained in this map
-
clear
public void clear()Removes all entities from this structure . The map will be empty after this call returns. -
equals
-
hashCode
public int hashCode() -
toString
-