Class DataStructure

java.lang.Object
expert.os.integration.microstream.DataStructure

public class DataStructure extends Object
The data structure used at Microstream on both Template and any DataRepository implementation.

It is a wrapper of LazyHashMap

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all entities from this structure .
    boolean
     
    <K, V> Optional<V>
    get(K key)
    * Returns the value to which the specified key is mapped, or Optional#empty() if this map contains no mapping for the key.
    int
     
    boolean
    Returns true if 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> void
    remove(K key)
    Removes the mapping for a key from this map if it is present
    int
    Returns the number of key-value mappings in this map.
     
    <V> Stream<V>
    Returns a Collection view of the values contained in this map.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 type
      V - the entity type
      Parameters:
      key - the key
      value - the entity
    • get

      public <K, V> Optional<V> get(K key)
      * Returns the value to which the specified key is mapped, or Optional#empty() if this map contains no mapping for the key.
      Type Parameters:
      K - the key type
      V - 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()
      Returns true if this map contains no key-value mappings.
      Returns:
      true if this map contains no key-value mappings
    • values

      public <V> Stream<V> values()
      Returns a Collection view 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object