|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.cache.CacheLoader<K,V>
@Beta public abstract class CacheLoader<K,V>
Computes or retrieves values, based on a key, for use in populating a Cache
.
Constructor Summary | |
---|---|
CacheLoader()
|
Method Summary | ||
---|---|---|
static
|
from(Function<K,V> function)
Returns a CacheLoader which creates values by applying a Function to the key. |
|
static
|
from(Supplier<V> supplier)
Returns a CacheLoader which obtains values from a Supplier (independent of the
key). |
|
abstract V |
load(K key)
Computes or retrieves the value corresponding to key . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheLoader()
Method Detail |
---|
public static <K,V> CacheLoader<K,V> from(Function<K,V> function)
CacheLoader
which creates values by applying a Function
to the key.
public static <V> CacheLoader<Object,V> from(Supplier<V> supplier)
CacheLoader
which obtains values from a Supplier
(independent of the
key).
public abstract V load(K key) throws Exception
key
.
key
- the key whose value should be loaded; will never be null
key
; may not be null
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |