Class Cache.UnboundAtomicMapCache<K,​V>

  • All Implemented Interfaces:
    Cache<K,​V>
    Enclosing interface:
    Cache<K,​V>

    public static class Cache.UnboundAtomicMapCache<K,​V>
    extends java.lang.Object
    implements Cache<K,​V>
    Simple cache implementation based on atomic reference on unbound hash map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V get​(K key, java.util.function.Supplier<V> onMiss)
      Get the value from cache based by key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnboundAtomicMapCache

        public UnboundAtomicMapCache()
    • Method Detail

      • get

        public V get​(K key,
                     java.util.function.Supplier<V> onMiss)
        Description copied from interface: Cache
        Get the value from cache based by key.
        Specified by:
        get in interface Cache<K,​V>
        Parameters:
        key - Key to get a value from the cache
        onMiss - Supplier for a value in case it's missing in cache