Cache.Loader<KK,VV>, Cache.RemovalListener<KK,VV>, Cache.RemovalNotification<KK,VV>, Cache.Statistics, Cache.UncheckedExecutionException, Cache.Weigher<KK,VV>
Constructor and Description |
---|
GuavaCache(com.google.common.cache.Cache<K,V> guavaCache) |
Modifier and Type | Method and Description |
---|---|
ConcurrentMap<K,V> |
asMap()
Provide a view into the cache as a
Map . |
void |
cleanUp()
Run cache clean-up, e.g.
|
V |
getIfPresent(K key)
Get the value for the key if it exists in the cache, otherwise return null.
|
Cache.Statistics |
getStatistics()
Returns statistics, if enabled.
|
void |
invalidate(K key)
Invalidate a single cache entry.
|
void |
invalidateAll()
Invalidate all cache entries.
|
void |
put(K key,
V value)
Put the value for the key into the cache.
|
@ConstructorProperties(value="guavaCache") public GuavaCache(com.google.common.cache.Cache<K,V> guavaCache)
public void invalidateAll()
Cache
invalidateAll
in interface Cache<K,V>
public void invalidate(K key)
Cache
invalidate
in interface Cache<K,V>
key
- key for the entry to be invalidatedpublic void cleanUp()
Cache
public ConcurrentMap<K,V> asMap()
Cache
Map
.public Cache.Statistics getStatistics()
Cache
getStatistics
in interface Cache<K,V>
public V getIfPresent(K key)
Cache
getIfPresent
in interface Cache<K,V>
key
- keyCopyright © 2016–2023. All rights reserved.