public class Cache<K,V> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Cache.MissHandler<L,W>
Deprecated.
use
CacheLoader instead |
| Constructor and Description |
|---|
Cache(String name,
int size,
com.github.benmanes.caffeine.cache.CacheLoader<K,V> loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
evict(K key)
This will evict a specific key from the cache.
|
V |
get(K key)
This will get a specific entry calling the loader if no entry exists
|
String |
getName() |
com.github.benmanes.caffeine.cache.stats.CacheStats |
getStats() |
Cache<K,V> |
logEveryNSeconds(int seconds,
ILogger logger)
Sets up a recurring task every n seconds to report on the status of this cache.
|
static <KK,VV> Cache<KK,VV> |
make(String name,
int size,
com.github.benmanes.caffeine.cache.CacheLoader<KK,VV> loader) |
void |
put(K key,
V value)
This will put a specific entry in the cache
|
void |
stopLogging() |
String |
toString() |
public void evict(K key)
key - the key to evictpublic void put(K key, V value)
key - this is the key, must not be nullvalue - this is the value, null value is not entered into the mappublic V get(K key)
key - the object to findpublic com.github.benmanes.caffeine.cache.stats.CacheStats getStats()
public String getName()
public Cache<K,V> logEveryNSeconds(int seconds, ILogger logger)
seconds - how often to log the entrylogger - the logger to usepublic void stopLogging()
public void clear()
Copyright © 2018. All rights reserved.