Interface CacheKeyPrefix
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
CacheKeyPrefix
is a callback hook for creating custom prefixes prepended to the actual key
stored in Redis.- Since:
- 2.0.4
- Author:
- Christoph Strobl, Mark Paluch, John Blum
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCompute theprefix
for the actual cache key stored in Redis.static CacheKeyPrefix
Creates aCacheKeyPrefix
scheme that prefixes cache keys with the givenprefix
.static CacheKeyPrefix
simple()
Creates a defaultCacheKeyPrefix
scheme that prefixes cache keys with thename
of the cache followed by double colons.
-
Field Details
-
SEPARATOR
-
-
Method Details
-
compute
-
simple
Creates a defaultCacheKeyPrefix
scheme that prefixes cache keys with thename
of the cache followed by double colons. For example, a cache named myCache will prefix all cache keys with myCache::.- Returns:
- the default
CacheKeyPrefix
scheme.
-
prefixed
Creates aCacheKeyPrefix
scheme that prefixes cache keys with the givenprefix
. Theprefix
is prepended to thecacheName
followed by double colons. For example, a prefix redis- with a cache named myCache results in redis-myCache::.- Parameters:
prefix
- must not be null.- Returns:
- the default
CacheKeyPrefix
scheme. - Since:
- 2.3
-