Modifier and Type | Class and Description |
---|---|
private static class |
JCacheCache.NullHolder |
Cache.ValueWrapper
Modifier and Type | Field and Description |
---|---|
private boolean |
allowNullValues |
private javax.cache.Cache |
cache |
private static java.lang.Object |
NULL_HOLDER |
Constructor and Description |
---|
JCacheCache(
Create an
JCacheCache instance. |
JCacheCache(
Create an
JCacheCache instance. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all mappings from the cache.
|
void |
evict(java.lang.Object key)
Evict the mapping for this key from this cache if it is present.
|
protected java.lang.Object |
fromStoreValue(java.lang.Object storeValue)
Convert the given value from the internal store to a user value
returned from the get method (adapting
null ). |
Cache.ValueWrapper |
get(java.lang.Object key)
Return the value to which this cache maps the specified key.
|
java.lang.String |
getName()
Return the cache name.
|
|
getNativeCache()
Return the the underlying native cache provider.
|
boolean |
isAllowNullValues() |
void |
put(java.lang.Object key,
java.lang.Object value)
Associate the specified value with the specified key in this cache.
|
protected java.lang.Object |
toStoreValue(java.lang.Object userValue)
Convert the given user value, as passed into the put method,
to a value in the internal store (adapting
null ). |
private static final java.lang.Object NULL_HOLDER
private final javax.cache.Cache cache
private final boolean allowNullValues
public JCacheCache(jcache)
JCacheCache
instance.jcache
- backing JCache Cache instancepublic JCacheCache(jcache, boolean allowNullValues)
JCacheCache
instance.jcache
- backing JCache Cache instanceallowNullValues
- whether to accept and convert null values for this cachepublic java.lang.String getName()
Cache
publicgetNativeCache()
Cache
getNativeCache
in interface Cache
public boolean isAllowNullValues()
public Cache.ValueWrapper get(java.lang.Object key)
Cache
null
if the cache contains no mapping for this key.public void put(java.lang.Object key, java.lang.Object value)
Cache
If the cache previously contained a mapping for this key, the old value is replaced by the specified value.
public void evict(java.lang.Object key)
Cache
public void clear()
Cache
protected java.lang.Object fromStoreValue(java.lang.Object storeValue)
null
).storeValue
- the store valueprotected java.lang.Object toStoreValue(java.lang.Object userValue)
null
).userValue
- the given user value