Class LoadingCache<K,​KK,​V>


  • public class LoadingCache<K,​KK,​V>
    extends java.lang.Object
    • Field Detail

      • map

        protected final java.util.concurrent.ConcurrentMap<KK,​java.lang.Object> map
      • keyMapper

        protected final Function<K,​KK> keyMapper
      • IDENTITY

        public static final Function IDENTITY
    • Method Detail

      • identity

        public static <K> Function<K,​K> identity()
      • get

        public V get​(K key)
      • createEntry

        protected V createEntry​(K key,
                                KK cacheKey,
                                java.lang.Object v)
        Loads entry to the cache. If entry is missing, put FutureTask first so other competing thread might wait for the result.
        Parameters:
        key - original key that would be used to load the instance
        cacheKey - key that would be used to store the entry in internal map
        v - null or FutureTask
        Returns:
        newly created instance