public final class ValueCache<K,V,T extends java.lang.Throwable>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ValueCache.ThrowingValueComputer<K,V,T extends java.lang.Throwable> |
static interface |
ValueCache.ValueComputer<K,V> |
Modifier and Type | Field and Description |
---|---|
private ValueCache.ThrowingValueComputer<K,V,T> |
computer |
private java.util.concurrent.ConcurrentMap<K,java.lang.ref.SoftReference<V>> |
map |
Modifier | Constructor and Description |
---|---|
private |
ValueCache(ValueCache.ThrowingValueComputer<K,V,T> computer) |
Modifier and Type | Method and Description |
---|---|
V |
computeIfAbsent(K key) |
void |
invalidate() |
static <K,V,T extends java.lang.Throwable> |
on(ValueCache.ThrowingValueComputer<K,V,T> computer) |
private final ValueCache.ThrowingValueComputer<K,V,T extends java.lang.Throwable> computer
private ValueCache(ValueCache.ThrowingValueComputer<K,V,T> computer)
public static <K,V,T extends java.lang.Throwable> ValueCache<K,V,T> on(ValueCache.ThrowingValueComputer<K,V,T> computer)
public V computeIfAbsent(K key) throws T extends java.lang.Throwable
T extends java.lang.Throwable
public void invalidate()