Package net.sf.cglib.core.internal

## Class LoadingCache<K,​KK,​V>

- java.lang.Object
- - net.sf.cglib.core.internal.LoadingCache<K,​KK,​V>

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

### Field Summary

Fields
`static Function` `IDENTITY`
`protected Function<K,​KK>` `keyMapper`
`protected Function<K,​V>` `loader`
`protected java.util.concurrent.ConcurrentMap<KK,​java.lang.Object>` `map`

### Constructor Summary

Constructors
`LoadingCache​(Function<K,​KK> keyMapper, Function<K,​V> loader)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected V` `createEntry​(K key, KK cacheKey, java.lang.Object v)` Loads entry to the cache.
`V` `get​(K key)`
`static <K> Function<K,​K>` `identity()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### map

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

#### loader

    protected final Function<K,​V> loader

#### keyMapper

    protected final Function<K,​KK> keyMapper

#### IDENTITY

    public static final Function IDENTITY

### Constructor Detail

#### LoadingCache

    public LoadingCache​(Function<K,​KK> keyMapper,
                        Function<K,​V> loader)

### 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