Note that get, getUnchecked, and apply all expose the same
underlying functionality, so should probably be overridden as a group.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | ForwardingLoadingCache.
A simplified version of |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public V | apply(K
the function argument key)Implements com. |
| protected abstract LoadingCache | delegate()
Implements abstract com. |
| public V | get(K key)
Implements com. key in this cache, first loading that value if
necessary.
|
| public ImmutableMap | getAll(Iterable<? extends K> keys)
Implements com. keys, creating or retrieving those values
if necessary.
|
| public V | getUnchecked(K key)
Implements com. key in this cache, first loading that value if
necessary.
|
| public void | refresh(K key)
Implements com. key, possibly asynchronously.
|
| ForwardingLoadingCache | back to summary |
|---|---|
| protected ForwardingLoadingCache() Constructor for use by subclasses. | |
| apply | back to summary |
|---|---|
| public V apply(K key) Implements com. Doc from java. Applies this function to the given argument.
| |
| delegate | back to summary |
|---|---|
| protected abstract LoadingCache Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| get | back to summary |
|---|---|
| public V get(K key) throws ExecutionException Implements com. Doc from com. Returns the value associated with If another call to Caches loaded by a If the cache loader associated with this cache is known not to throw checked exceptions,
then prefer
| |
| getAll | back to summary |
|---|---|
| public ImmutableMap Implements com. Doc from com. Returns a map of the values associated with Caches loaded by a Note that duplicate elements in
| |
| getUnchecked | back to summary |
|---|---|
| public V getUnchecked(K key) Implements com. Doc from com. Returns the value associated with If another call to Caches loaded by a Warning this method silently converts checked exceptions to unchecked exceptions,
and should not be used with cache loaders which throw checked exceptions. In such cases use
| |
| refresh | back to summary |
|---|---|
| public void refresh(K key) Implements com. Doc from com. Loads a new value for Caches loaded by a Returns without doing anything if another thread is currently loading the value for
| |
ForwardingLoadingCache where subclasses can pass in an already
constructed LoadingCache as the delegate.
| Modifier and Type | Field and Description |
|---|---|
| private final LoadingCache |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected final LoadingCache | delegate()
Implements abstract com. |
| delegate | back to summary |
|---|---|
| private final LoadingCache<K, V> delegate | |
| SimpleForwardingLoadingCache | back to summary |
|---|---|
| protected SimpleForwardingLoadingCache(LoadingCache<K, V> delegate) | |
| delegate | back to summary |
|---|---|
| protected final LoadingCache Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |