Class CouchbaseCache
java.lang.Object
org.springframework.cache.support.AbstractValueAdaptingCache
org.springframework.data.couchbase.cache.CouchbaseCache
- All Implemented Interfaces:
Cache
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.cache.Cache
Cache.ValueRetrievalException, Cache.ValueWrapper
-
Constructor Summary
ModifierConstructorDescriptionprotected
CouchbaseCache
(String name, CouchbaseCacheWriter cacheWriter, CouchbaseCacheConfiguration cacheConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected String
convertKey
(Object key) Convertkey
to aString
representation used for cache key creation.protected String
createCacheKey
(Object key) Customization hook for creating cache key before it gets serialized.void
boolean
evictIfPresent
(Object key) <T> T
Returns the configuration for thisCouchbaseCache
.getName()
boolean
protected Object
void
putIfAbsent
(Object key, Object value) Methods inherited from class org.springframework.cache.support.AbstractValueAdaptingCache
fromStoreValue, get, get, isAllowNullValues, toStoreValue, toValueWrapper
-
Constructor Details
-
CouchbaseCache
protected CouchbaseCache(String name, CouchbaseCacheWriter cacheWriter, CouchbaseCacheConfiguration cacheConfig)
-
-
Method Details
-
getName
-
getNativeCache
-
lookup
- Specified by:
lookup
in classAbstractValueAdaptingCache
-
getCacheConfiguration
Returns the configuration for thisCouchbaseCache
. -
get
-
put
-
putIfAbsent
-
evict
-
evictIfPresent
-
invalidate
public boolean invalidate() -
clear
public void clear() -
createCacheKey
Customization hook for creating cache key before it gets serialized.- Parameters:
key
- will never be null.- Returns:
- never null.
-
convertKey
Convertkey
to aString
representation used for cache key creation.- Parameters:
key
- will never be null.- Returns:
- never null.
- Throws:
IllegalStateException
- ifkey
cannot be converted toString
.
-