MCPcopy Index your code
hub / github.com/antlr/codebuff / ForwardingCache

Class ForwardingCache

corpus/java/training/guava/cache/ForwardingCache.java:37–143  ·  view source on GitHub ↗

A cache which forwards all its method calls to another cache. Subclasses should override one or more methods to modify the behavior of the backing cache as desired per the decorator pattern . @author Charles Fry @since 10.0

Source from the content-addressed store, hash-verified

35 * @since 10.0
36 */
37@GwtIncompatible
38public abstract class ForwardingCache<K, V> extends ForwardingObject implements Cache<K, V> {
39
40 /** Constructor for use by subclasses. */
41 protected ForwardingCache() {}
42
43 @Override
44 protected abstract Cache<K, V> delegate();
45
46 /**
47 * @since 11.0
48 */
49 @Override
50 @Nullable
51 public V getIfPresent(Object key) {
52 return delegate().getIfPresent(key);
53 }
54
55 /**
56 * @since 11.0
57 */
58 @Override
59 public V get(K key, Callable<? extends V> valueLoader) throws ExecutionException {
60 return delegate().get(key, valueLoader);
61 }
62
63 /**
64 * @since 11.0
65 */
66 @Override
67 public ImmutableMap<K, V> getAllPresent(Iterable<?> keys) {
68 return delegate().getAllPresent(keys);
69 }
70
71 /**
72 * @since 11.0
73 */
74 @Override
75 public void put(K key, V value) {
76 delegate().put(key, value);
77 }
78
79 /**
80 * @since 12.0
81 */
82 @Override
83 public void putAll(Map<? extends K, ? extends V> m) {
84 delegate().putAll(m);
85 }
86
87 @Override
88 public void invalidate(Object key) {
89 delegate().invalidate(key);
90 }
91
92 /**
93 * @since 11.0
94 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected