Interface StateHolder<K,​V>

  • Type Parameters:
    K - type of Keys
    V - type of Values

    public interface StateHolder<K,​V>
    A Map like structure that can hold key value mappings.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
      Retrieves all the entries in the StateHolder as a Set of Map.Entry instances.
      V get​(K key)
      Retrieves the value mapped to the given key
      V putIfAbsent​(K key, V value)
      If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
    • Method Detail

      • putIfAbsent

        V putIfAbsent​(K key,
                      V value)
        If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
        Parameters:
        key - a key
        value - a value
        Returns:
        the previous value associated with the specified key, or null if there was no mapping for the key.
      • get

        V get​(K key)
        Retrieves the value mapped to the given key
        Parameters:
        key - a key
        Returns:
        the value mapped to the key
      • entrySet

        java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Retrieves all the entries in the StateHolder as a Set of Map.Entry instances.
        Returns:
        the set of this StateHolder mappings