Package org.springframework.cache.jcache

# Class JCacheCache

java.lang.Object
org.springframework.cache.support.AbstractValueAdaptingCache
org.springframework.cache.jcache.JCacheCache

All Implemented Interfaces:
  `org.springframework.cache.Cache`

public class JCacheCache extends org.springframework.cache.support.AbstractValueAdaptingCache
`Cache` implementation on top of a `javax.cache.Cache` instance.

Note: This class has been updated for JCache 1.0, as of Spring 4.0.

Since:
  3.2
Author:
  Juergen Hoeller, Stephane Nicoll
See Also:
  - `JCacheCacheManager`

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.springframework.cache.Cache

`org.springframework.cache.Cache.ValueRetrievalException, org.springframework.cache.Cache.ValueWrapper`

## Constructor Summary

Constructors
Constructor
Description
`JCacheCache(javax.cache.Cache<Object,Object> jcache)`
Create a `JCacheCache` instance.
`JCacheCache(javax.cache.Cache<Object,Object> jcache, boolean allowNullValues)`
Create a `JCacheCache` instance.

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
`void`
`evict(Object key)`
`boolean`
`evictIfPresent(Object key)`
`<T> T`
`get(Object key, Callable<T> valueLoader)`
`final String`
`getName()`
`final javax.cache.Cache<Object,Object>`
`getNativeCache()`
`boolean`
`invalidate()`
`protected Object`
`lookup(Object key)`
`void`
`put(Object key, Object value)`
`org.springframework.cache.Cache.ValueWrapper`
`putIfAbsent(Object key, Object value)`

### Methods inherited from class org.springframework.cache.support.AbstractValueAdaptingCache

`fromStoreValue, get, get, isAllowNullValues, toStoreValue, toValueWrapper`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.cache.Cache

`retrieve, retrieve`

## Constructor Details

### JCacheCache

public JCacheCache(javax.cache.Cache<Object,Object> jcache)
Create a `JCacheCache` instance.

Parameters:
  `jcache` - backing JCache Cache instance

### JCacheCache

public JCacheCache(javax.cache.Cache<Object,Object> jcache, boolean allowNullValues)
Create a `JCacheCache` instance.

Parameters:
  `jcache` - backing JCache Cache instance
  `allowNullValues` - whether to accept and convert null values for this cache

## Method Details

### getName

public final String getName()

### getNativeCache

public final javax.cache.Cache<Object,Object> getNativeCache()

### lookup

@Nullable protected Object lookup(Object key)

Specified by:
  `lookup` in class `org.springframework.cache.support.AbstractValueAdaptingCache`

### get

@Nullable public <T> T get(Object key, Callable<T> valueLoader)

### put

public void put(Object key, @Nullable Object value)

### putIfAbsent

@Nullable public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, @Nullable Object value)

### evict

public void evict(Object key)

### evictIfPresent

public boolean evictIfPresent(Object key)

### clear

public void clear()

### invalidate

public boolean invalidate()