public class CacheAttributesChecker extends CacheWrapper
cache
Constructor and Description |
---|
CacheAttributesChecker(CacheManagement cache) |
Modifier and Type | Method and Description |
---|---|
Serializable |
get(String key)
Get method to retrieve value from cache Must not raise exception if the key is null, but return null
|
long |
getSize()
Returns this cache size (approximate number of entries), or
-1 if the number of entries is unknown or too
expensive to compute. |
boolean |
hasEntry(String key)
Check if a given key is present inside the cache.
|
void |
invalidate(String key)
Invalidate the given key
|
void |
invalidateAll()
Invalidate all key-value stored in the cache
|
Set<String> |
keySet()
Returns the set of all keys stored in the cache.
|
void |
put(String key,
Serializable value)
Put method to store a
Serializable value |
getName, invalidateLocal, invalidateLocalAll, putLocal, start, stop, toString
public CacheAttributesChecker(CacheManagement cache)
public Serializable get(String key)
Cache
get
in interface Cache
get
in class CacheWrapper
key
- the string keySerializable
value, return null if the key does not exist or if the key is nullpublic Set<String> keySet()
Cache
keySet
in interface Cache
keySet
in class CacheWrapper
Set
of all keyspublic void invalidate(String key)
Cache
invalidate
in interface Cache
invalidate
in class CacheWrapper
public void invalidateAll()
Cache
invalidateAll
in interface Cache
invalidateAll
in class CacheWrapper
public void put(String key, Serializable value)
Cache
Serializable
valueput
in interface Cache
put
in class CacheWrapper
key
- the string key, if null, the value will not be storedvalue
- the value to store, if null, the value will not be storedpublic boolean hasEntry(String key)
Cache
hasEntry
in interface Cache
hasEntry
in class CacheWrapper
key
- the string keypublic long getSize()
CacheManagement
-1
if the number of entries is unknown or too
expensive to compute.getSize
in interface CacheManagement
getSize
in class CacheWrapper
-1
Copyright © 2018 Nuxeo. All rights reserved.