diff --git a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java index 5a1024df0..c63face17 100644 --- a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java +++ b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java @@ -30,7 +30,7 @@ public interface CacheKeyPrefix { /** * Default separator. - * + * * @since 2.3 */ String SEPARATOR = "::"; @@ -54,9 +54,9 @@ public interface CacheKeyPrefix { } /** - * Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@code prefix} prepended to the - * {@code cacheName} followed by double colons. A cache named {@code myCache} with prefix {@code redis-} will result - * in {@code redis-myCache::}. + * Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@code prefix}. The prefix is + * prepended to the {@code cacheName} followed by double colons. A prefix {@code redis-} with a cache named + * {@code myCache} results in {@code redis-myCache::}. * * @param prefix must not be {@literal null}. * @return the default {@link CacheKeyPrefix} scheme. diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java index 98b874893..bd9748d6f 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java @@ -144,14 +144,15 @@ public class RedisCacheConfiguration { } /** - * Use the given prefix instead of the default one.
- * This option overrides the default cache name and is not recommended. {@link #prefixCacheNameWith(String)} or - * {@link #computePrefixWith(CacheKeyPrefix)}.
+ * Use the given prefix instead of using the cache name.
+ * This option replaces the cache name with {@code prefix} therefore we recommend rather using + * {@link #prefixCacheNameWith(String)} or {@link #computePrefixWith(CacheKeyPrefix)} for more control.
* The generated cache key will be: {@code prefix + cache entry key}. * * @param prefix must not be {@literal null}. * @return new {@link RedisCacheConfiguration}. - * @deprecated since 2.3. Use {@link #prefixCacheNameWith(String)} or {@link #computePrefixWith(CacheKeyPrefix)} instead. + * @deprecated since 2.3. Use {@link #prefixCacheNameWith(String)} or {@link #computePrefixWith(CacheKeyPrefix)} + * instead. */ @Deprecated public RedisCacheConfiguration prefixKeysWith(String prefix) { @@ -176,12 +177,13 @@ public class RedisCacheConfiguration { } /** - * Use the given {@link CacheKeyPrefix} to compute the prefix for the actual Redis {@literal key} on the - * {@literal cache name}. + * Use the given {@link CacheKeyPrefix} to compute the prefix for the actual Redis {@literal key} given the + * {@literal cache name} as function input. * * @param cacheKeyPrefix must not be {@literal null}. * @return new {@link RedisCacheConfiguration}. * @since 2.0.4 + * @see CacheKeyPrefix */ public RedisCacheConfiguration computePrefixWith(CacheKeyPrefix cacheKeyPrefix) {