Class ThreadLocalCache<K,​V>

  • Type Parameters:
    K - cache key type
    V - cache value type

    public final class ThreadLocalCache<K,​V>
    extends Object
    Provides a ThreadLocal cache with a maximum cache size per thread. Values must not be null.
    • Constructor Detail

      • ThreadLocalCache

        public ThreadLocalCache​(int maxSizePerThread,
                                Function<K,​V> loader)
    • Method Detail

      • get

        public V get​(K key)