Interface Cache<K,V>

Type Parameters:
K - the key type
V - the value type

public interface Cache<K,V>
A level-one cache of server-side state.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value associated with the specified key from this cache, generating it from the specified function, if necessary.
    Returns the set of keys of this cache.
  • Method Details

    • computeIfAbsent

      V computeIfAbsent(K key, BiFunction<K,Runnable,V> factory)
      Returns the value associated with the specified key from this cache, generating it from the specified function, if necessary.
      Parameters:
      key - a key by which the value may be referenced
      factory - a factory for creating the value if it does not already exist within this context.
      Returns:
      the value, obtained from this context, or generated from the specified factory.
    • keySet

      Set<K> keySet()
      Returns the set of keys of this cache.
      Returns:
      the set of keys of this cache.