Package one.microstream.cache.types
Interface Cache<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Superinterfaces:
AutoCloseable,javax.cache.Cache<K,V>,Closeable,Iterable<javax.cache.Cache.Entry<K,V>>,Unwrappable
- All Known Implementing Classes:
Cache.Default
public interface Cache<K,V> extends javax.cache.Cache<K,V>, Unwrappable
JSR-107 compliant
Cache.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCache.Default<K,V>Nested classes/interfaces inherited from interface javax.cache.Cache
javax.cache.Cache.Entry<K extends Object,V extends Object>Nested classes/interfaces inherited from interface one.microstream.cache.types.Unwrappable
Unwrappable.Static -
Method Summary
Modifier and Type Method Description voidevict(Iterable<KeyValue<Object,CachedValue>> entriesToEvict)Evicts given entries from this cache.CacheManagergetCacheManager()CacheConfiguration<K,V>getConfiguration()Returns theCacheConfigurationwhich was used to create this cache.static <K, V> Cache<K,V>New(String name, CacheManager manager, CacheConfiguration<K,V> configuration)default voidputAll(Map<? extends K,? extends V> map)Adds all entries to this cache.default voidputAll(Map<? extends K,? extends V> map, boolean replaceExistingValues)Adds all entries to this cache.voidputAll(Map<? extends K,? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)Adds all entries to this cache.voidsetManagementEnabled(boolean enabled)Enables or disables the management bean of this cache.voidsetStatisticsEnabled(boolean enabled)Enables or disables statistics gathering.longsize()Returns the amount of entries in this cache.default <T> Tunwrap(Class<T> clazz)Methods inherited from interface javax.cache.Cache
clear, close, containsKey, deregisterCacheEntryListener, get, getAll, getAndPut, getAndRemove, getAndReplace, getConfiguration, getName, invoke, invokeAll, isClosed, iterator, loadAll, put, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace
-
Method Details
-
getCacheManager
CacheManager getCacheManager() -
getConfiguration
CacheConfiguration<K,V> getConfiguration()Returns theCacheConfigurationwhich was used to create this cache. -
size
long size()Returns the amount of entries in this cache.- Returns:
- this cache's size
-
putAll
Adds all entries to this cache.Short for
putAll(map, true)- Specified by:
putAllin interfacejavax.cache.Cache<K,V>- See Also:
putAll(Map, boolean)
-
putAll
Adds all entries to this cache.Short for
putAll(map, replaceExistingValues, true)- See Also:
putAll(Map, boolean, boolean)
-
putAll
void putAll(Map<? extends K,? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)Adds all entries to this cache.- Parameters:
map- entries to addreplaceExistingValues- if values with same keys should be replacesuseWriteThrough- enable write through mode for this operation
-
setManagementEnabled
void setManagementEnabled(boolean enabled)Enables or disables the management bean of this cache. -
setStatisticsEnabled
void setStatisticsEnabled(boolean enabled)Enables or disables statistics gathering. -
evict
Evicts given entries from this cache. -
unwrap
- Specified by:
unwrapin interfacejavax.cache.Cache<K,V>- Specified by:
unwrapin interfaceUnwrappable
-
New
static <K, V> Cache<K,V> New(String name, CacheManager manager, CacheConfiguration<K,V> configuration)
-