@Authors(value="Nikolche Mihajlovski") @Since(value="5.3.0") public interface Cache<K,V>
| Modifier and Type | Method and Description |
|---|---|
void |
bypass()
Notifies the cache that it's being bypassed due to any reason (useful for stats).
|
void |
clear()
Clears the cache.
|
V |
get(K key)
Returns the cached value for the given key, recalculating/reloading it if expired.
|
V |
getIfExists(K key)
Retrieves the cached value for the given key if it exists, or
null otherwise. |
void |
invalidate(K key)
Invalidates the cached value for the given key.
|
void |
set(K key,
V value)
Sets a new cached value for the given key.
|
int |
size() |
CacheStats |
stats()
Retrieves the cache statistics.
|
V getIfExists(K key)
null otherwise.void invalidate(K key)
void clear()
int size()
void bypass()
CacheStats stats()
Copyright © 2014–2018 Nikolche Mihajlovski and contributors. All rights reserved.