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
ConstructorsModifierConstructorDescriptionprotectedCouchbaseCache(String name, CouchbaseCacheWriter cacheWriter, CouchbaseCacheConfiguration cacheConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected StringconvertKey(Object key) Convertkeyto aStringrepresentation used for cache key creation.protected StringcreateCacheKey(Object key) Customization hook for creating cache key before it gets serialized.voidbooleanevictIfPresent(Object key) <T> TReturns the configuration for thisCouchbaseCache.getName()booleanprotected ObjectvoidputIfAbsent(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:
lookupin 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
Convertkeyto aStringrepresentation used for cache key creation.- Parameters:
key- will never be null.- Returns:
- never null.
- Throws:
IllegalStateException- ifkeycannot be converted toString.
-