| Modifier | Constructor and Description |
|---|---|
protected |
GuavaCache(int aInitialCapacity,
long aMaximumCapacity,
Long aExpireAfterAccess,
TimeUnit aExpireAfterAccessTimeUnit,
Long aExpireAfterWrite,
TimeUnit aExpireAfterWriteTimeUnit,
LoadFunction<K,V> aFunctionLoad,
boolean skipConfiguration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Cleanup cache.
|
void |
configureCache()
Cache configuration.
|
Collection<V> |
get(Iterable<? extends K> keys)
Get values by
keys. |
V |
get(K key)
Get value by
key from cache. |
Collection<V> |
getAll()
Get all values from cache.
|
Map<K,V> |
getAllAsMap()
Get all values from cache as
Map. |
void |
invalidate(Iterable<? extends K> keys)
Invalidate values by
keys. |
void |
invalidate(K key)
Invalidate element in cache by
key. |
void |
invalidateAll()
Invalidate all values in cache.
|
boolean |
isEmpty()
Is empty.
|
void |
put(K key,
V value)
Put
value by key to cache. |
void |
put(Map<K,V> elements)
Put
elements to cache. |
void |
setExpireAfterAccess(Long expireAfterAccess) |
void |
setExpireAfterAccessTimeUnit(TimeUnit expireAfterAccessTimeUnit) |
void |
setExpireAfterWrite(Long expireAfterWrite) |
void |
setExpireAfterWriteTimeUnit(TimeUnit expireAfterWriteTimeUnit) |
void |
setInitialCapacity(int aInitialCapacity) |
void |
setInitiateCapacity(int aInitialCapacity)
Deprecated.
|
void |
setMaximumCapacity(long maximumCapacity) |
void |
setOriginalCache(com.google.common.cache.Cache<K,V> originalCache) |
long |
size()
Get cache size.
|
String |
toString() |
protected GuavaCache(int aInitialCapacity,
long aMaximumCapacity,
Long aExpireAfterAccess,
TimeUnit aExpireAfterAccessTimeUnit,
Long aExpireAfterWrite,
TimeUnit aExpireAfterWriteTimeUnit,
LoadFunction<K,V> aFunctionLoad,
boolean skipConfiguration)
aInitialCapacity - Initial capacityaMaximumCapacity - Maximum capacityaExpireAfterAccess - Expiration time after last accessaExpireAfterAccessTimeUnit - TimeUnit for access expirationaExpireAfterWrite - Expiration time after last writeaExpireAfterWriteTimeUnit - TimeUnit for write expirationaFunctionLoad - LoadFunctionskipConfiguration - is configuration should be skippedpublic void setInitialCapacity(int aInitialCapacity)
@Deprecated public void setInitiateCapacity(int aInitialCapacity)
setInitialCapacity instead.aInitialCapacity - public void setMaximumCapacity(long maximumCapacity)
public void setExpireAfterAccess(Long expireAfterAccess)
public void setExpireAfterAccessTimeUnit(TimeUnit expireAfterAccessTimeUnit)
public void setExpireAfterWrite(Long expireAfterWrite)
public void setExpireAfterWriteTimeUnit(TimeUnit expireAfterWriteTimeUnit)
public void configureCache()
public void put(K key, V value)
Cachevalue by key to cache.public void invalidate(K key)
Cachekey.invalidate in interface Cache<K,V>key - keypublic Collection<V> get(Iterable<? extends K> keys)
Cachekeys.public Collection<V> getAll()
Cachepublic Map<K,V> getAllAsMap()
CacheMap.getAllAsMap in interface Cache<K,V>Map with key/valuepublic void put(Map<K,V> elements)
Cacheelements to cache.public void invalidate(Iterable<? extends K> keys)
Cachekeys.invalidate in interface Cache<K,V>keys - Iterablepublic void invalidateAll()
CacheinvalidateAll in interface Cache<K,V>public long size()
Cachepublic void cleanUp()
Cachepublic boolean isEmpty()
CacheCopyright © 2013–2019 BB Corp. All rights reserved.