Package org.springframework.cglib.core.internal

# Class LoadingCache<K,KK,V>

java.lang.Object
org.springframework.cglib.core.internal.LoadingCache<K,KK,V>

public class LoadingCache<K,KK,V> extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Function`
`IDENTITY`
`protected final Function<K,KK>`
`keyMapper`
`protected final Function<K,V>`
`loader`
`protected final ConcurrentMap<KK,Object>`
`map`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`protected V`
`createEntry(K key, KK cacheKey, 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 Details

### map

protected final ConcurrentMap<KK,Object> map

### loader

protected final Function<K,V> loader

### keyMapper

protected final Function<K,KK> keyMapper

### IDENTITY

public static final Function IDENTITY

## Constructor Details

### LoadingCache

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

## Method Details

### identity

public static <K> Function<K,K> identity()

### get

public V get(K key)

### createEntry

protected V createEntry(K key, KK cacheKey, 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<V>`
Returns:
  newly created instance