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 theprefixfor the actual cache key stored in Redis.static CacheKeyPrefixCreates aCacheKeyPrefixscheme that prefixes cache keys with the givenprefix.static CacheKeyPrefixsimple()Creates a defaultCacheKeyPrefixscheme that prefixes cache keys with thenameof the cache followed by double colons.
-
Field Details
-
SEPARATOR
-
-
Method Details
-
compute
-
simple
Creates a defaultCacheKeyPrefixscheme that prefixes cache keys with thenameof the cache followed by double colons. For example, a cache named myCache will prefix all cache keys with myCache::.- Returns:
- the default
CacheKeyPrefixscheme.
-
prefixed
Creates aCacheKeyPrefixscheme that prefixes cache keys with the givenprefix. Theprefixis prepended to thecacheNamefollowed 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
CacheKeyPrefixscheme. - Since:
- 2.3
-