Skip to content

Commit f3fb97d

Browse files
committed
Re-apply code formatter.
Closes #3245.
1 parent 44b9d35 commit f3fb97d

File tree

215 files changed

+1225
-1732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+1225
-1732
lines changed

src/main/java/org/springframework/data/redis/ClusterRedirectException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
*/
3030
public class ClusterRedirectException extends DataRetrievalFailureException {
3131

32-
@Serial
33-
private static final long serialVersionUID = -857075813794333965L;
32+
@Serial private static final long serialVersionUID = -857075813794333965L;
3433

3534
private final int slot;
3635
private final String host;

src/main/java/org/springframework/data/redis/ClusterStateFailureException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
*/
3131
public class ClusterStateFailureException extends DataAccessResourceFailureException {
3232

33-
@Serial
34-
private static final long serialVersionUID = 333399051713240852L;
33+
@Serial private static final long serialVersionUID = 333399051713240852L;
3534

3635
/**
3736
* Creates new {@link ClusterStateFailureException}.

src/main/java/org/springframework/data/redis/TooManyClusterRedirectionsException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
*/
2828
public class TooManyClusterRedirectionsException extends DataRetrievalFailureException {
2929

30-
@Serial
31-
private static final long serialVersionUID = -2818933672669154328L;
30+
@Serial private static final long serialVersionUID = -2818933672669154328L;
3231

3332
/**
3433
* Creates new {@link TooManyClusterRedirectionsException}.

src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import org.springframework.util.Assert;
1919

2020
/**
21-
* {@link CacheKeyPrefix} is a callback hook for creating custom prefixes prepended to the actual {@literal key}
22-
* stored in Redis.
21+
* {@link CacheKeyPrefix} is a callback hook for creating custom prefixes prepended to the actual {@literal key} stored
22+
* in Redis.
2323
*
2424
* @author Christoph Strobl
2525
* @author Mark Paluch
@@ -39,18 +39,15 @@ public interface CacheKeyPrefix {
3939
/**
4040
* Compute the {@link String prefix} for the actual {@literal cache key} stored in Redis.
4141
*
42-
* @param cacheName {@link String name} of the cache in which the key is stored;
43-
* will never be {@literal null}.
44-
* @return the computed {@link String prefix} of the {@literal cache key} stored in Redis;
45-
* never {@literal null}.
42+
* @param cacheName {@link String name} of the cache in which the key is stored; will never be {@literal null}.
43+
* @return the computed {@link String prefix} of the {@literal cache key} stored in Redis; never {@literal null}.
4644
*/
4745
String compute(String cacheName);
4846

4947
/**
50-
* Creates a default {@link CacheKeyPrefix} scheme that prefixes cache keys with the {@link String name}
51-
* of the cache followed by double colons.
52-
*
53-
* For example, a cache named {@literal myCache} will prefix all cache keys with {@literal myCache::}.
48+
* Creates a default {@link CacheKeyPrefix} scheme that prefixes cache keys with the {@link String name} of the cache
49+
* followed by double colons. For example, a cache named {@literal myCache} will prefix all cache keys with
50+
* {@literal myCache::}.
5451
*
5552
* @return the default {@link CacheKeyPrefix} scheme.
5653
*/
@@ -59,12 +56,9 @@ static CacheKeyPrefix simple() {
5956
}
6057

6158
/**
62-
* Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@link String prefix}.
63-
*
64-
* The {@link String prefix} is prepended to the {@link String cacheName} followed by double colons.
65-
*
66-
* For example, a prefix {@literal redis-} with a cache named {@literal myCache}
67-
* results in {@literal redis-myCache::}.
59+
* Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@link String prefix}. The
60+
* {@link String prefix} is prepended to the {@link String cacheName} followed by double colons. For example, a prefix
61+
* {@literal redis-} with a cache named {@literal myCache} results in {@literal redis-myCache::}.
6862
*
6963
* @param prefix must not be {@literal null}.
7064
* @return the default {@link CacheKeyPrefix} scheme.

src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
* Immutable {@link RedisCacheConfiguration} used to customize {@link RedisCache} behavior, such as caching
3636
* {@literal null} values, computing cache key prefixes and handling binary serialization.
3737
* <p>
38-
* Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behavior
39-
* using the builder methods, such as {@link #entryTtl(Duration)}, {@link #serializeKeysWith(SerializationPair)}
40-
* and {@link #serializeValuesWith(SerializationPair)}.
38+
* Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behavior using the
39+
* builder methods, such as {@link #entryTtl(Duration)}, {@link #serializeKeysWith(SerializationPair)} and
40+
* {@link #serializeValuesWith(SerializationPair)}.
4141
*
4242
* @author Christoph Strobl
4343
* @author Mark Paluch
@@ -110,14 +110,10 @@ public static RedisCacheConfiguration defaultCacheConfig(@Nullable ClassLoader c
110110

111111
registerDefaultConverters(conversionService);
112112

113-
return new RedisCacheConfiguration(TtlFunction.persistent(),
114-
DEFAULT_CACHE_NULL_VALUES,
115-
DEFAULT_ENABLE_TIME_TO_IDLE_EXPIRATION,
116-
DEFAULT_USE_PREFIX,
117-
CacheKeyPrefix.simple(),
113+
return new RedisCacheConfiguration(TtlFunction.persistent(), DEFAULT_CACHE_NULL_VALUES,
114+
DEFAULT_ENABLE_TIME_TO_IDLE_EXPIRATION, DEFAULT_USE_PREFIX, CacheKeyPrefix.simple(),
118115
SerializationPair.fromSerializer(RedisSerializer.string()),
119-
SerializationPair.fromSerializer(RedisSerializer.java(classLoader)),
120-
conversionService);
116+
SerializationPair.fromSerializer(RedisSerializer.java(classLoader)), conversionService);
121117
}
122118

123119
private final boolean cacheNullValues;
@@ -189,9 +185,8 @@ DEFAULT_USE_PREFIX, cacheKeyPrefix, getKeySerializationPair(), getValueSerializa
189185
* @return new {@link RedisCacheConfiguration}.
190186
*/
191187
public RedisCacheConfiguration disableCachingNullValues() {
192-
return new RedisCacheConfiguration(getTtlFunction(), DO_NOT_CACHE_NULL_VALUES, isTimeToIdleEnabled(),
193-
usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
194-
getConversionService());
188+
return new RedisCacheConfiguration(getTtlFunction(), DO_NOT_CACHE_NULL_VALUES, isTimeToIdleEnabled(), usePrefix(),
189+
getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
195190
}
196191

197192
/**
@@ -203,21 +198,22 @@ public RedisCacheConfiguration disableCachingNullValues() {
203198
*/
204199
public RedisCacheConfiguration disableKeyPrefix() {
205200
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
206-
DO_NOT_USE_PREFIX, getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
201+
DO_NOT_USE_PREFIX, getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
202+
getConversionService());
207203
}
208204

209205
/**
210-
* Enables {@literal time-to-idle (TTI) expiration} on {@link Cache} read operations,
211-
* such as {@link Cache#get(Object)}.
206+
* Enables {@literal time-to-idle (TTI) expiration} on {@link Cache} read operations, such as
207+
* {@link Cache#get(Object)}.
212208
* <p>
213209
* Enabling this option applies the same {@link #getTtlFunction() TTL expiration policy} to {@link Cache} read
214210
* operations as it does for {@link Cache} write operations. In effect, this will invoke the Redis {@literal GETEX}
215211
* command in place of {@literal GET}.
216212
* <p>
217-
* Redis does not support the concept of {@literal TTI}, only {@literal TTL}. However, if {@literal TTL} expiration
218-
* is applied to all {@link Cache} operations, both read and write alike, and {@link Cache} operations passed with
219-
* expiration are used consistently across the application, then in effect, an application can achieve
220-
* {@literal TTI} expiration-like behavior.
213+
* Redis does not support the concept of {@literal TTI}, only {@literal TTL}. However, if {@literal TTL} expiration is
214+
* applied to all {@link Cache} operations, both read and write alike, and {@link Cache} operations passed with
215+
* expiration are used consistently across the application, then in effect, an application can achieve {@literal TTI}
216+
* expiration-like behavior.
221217
* <p>
222218
* Requires Redis 6.2.0 or newer.
223219
*
@@ -227,8 +223,7 @@ public RedisCacheConfiguration disableKeyPrefix() {
227223
*/
228224
public RedisCacheConfiguration enableTimeToIdle() {
229225
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), USE_TIME_TO_IDLE_EXPIRATION,
230-
usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
231-
getConversionService());
226+
usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
232227
}
233228

234229
/**
@@ -256,9 +251,8 @@ public RedisCacheConfiguration entryTtl(TtlFunction ttlFunction) {
256251

257252
Assert.notNull(ttlFunction, "TtlFunction must not be null");
258253

259-
return new RedisCacheConfiguration(ttlFunction, getAllowCacheNullValues(), isTimeToIdleEnabled(),
260-
usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
261-
getConversionService());
254+
return new RedisCacheConfiguration(ttlFunction, getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
255+
getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
262256
}
263257

264258
/**
@@ -271,8 +265,8 @@ public RedisCacheConfiguration serializeKeysWith(SerializationPair<String> keySe
271265

272266
Assert.notNull(keySerializationPair, "KeySerializationPair must not be null");
273267

274-
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
275-
usePrefix(), getKeyPrefix(), keySerializationPair, getValueSerializationPair(), getConversionService());
268+
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
269+
getKeyPrefix(), keySerializationPair, getValueSerializationPair(), getConversionService());
276270
}
277271

278272
/**
@@ -285,8 +279,8 @@ public RedisCacheConfiguration serializeValuesWith(SerializationPair<?> valueSer
285279

286280
Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null");
287281

288-
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
289-
usePrefix(), getKeyPrefix(), getKeySerializationPair(), valueSerializationPair, getConversionService());
282+
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
283+
getKeyPrefix(), getKeySerializationPair(), valueSerializationPair, getConversionService());
290284
}
291285

292286
/**
@@ -299,8 +293,8 @@ public RedisCacheConfiguration withConversionService(ConversionService conversio
299293

300294
Assert.notNull(conversionService, "ConversionService must not be null");
301295

302-
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
303-
usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), conversionService);
296+
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
297+
getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), conversionService);
304298
}
305299

306300
/**
@@ -316,7 +310,7 @@ public boolean getAllowCacheNullValues() {
316310
* Use {@link #enableTimeToIdle()} to opt-in and enable {@literal time-to-idle (TTI) expiration} for caching.
317311
*
318312
* @return {@literal true} if {@literal time-to-idle (TTI) expiration} was configured and enabled for caching.
319-
* Defaults to {@literal false}.
313+
* Defaults to {@literal false}.
320314
* @see <a href="https://redis.io/commands/getex/">GETEX</a>
321315
* @since 3.2.0
322316
*/
@@ -400,8 +394,8 @@ public TtlFunction getTtlFunction() {
400394
}
401395

402396
/**
403-
* Adds a {@link Converter} to extract the {@link String} representation of a {@literal cache key}
404-
* if no suitable {@link Object#toString()} method is present.
397+
* Adds a {@link Converter} to extract the {@link String} representation of a {@literal cache key} if no suitable
398+
* {@link Object#toString()} method is present.
405399
*
406400
* @param cacheKeyConverter {@link Converter} used to convert a {@literal cache key} into a {@link String}.
407401
* @throws IllegalStateException if {@link #getConversionService()} does not allow {@link Converter} registration.
@@ -415,8 +409,8 @@ public void addCacheKeyConverter(Converter<?, String> cacheKeyConverter) {
415409
/**
416410
* Configure the underlying {@link ConversionService} used to extract the {@literal cache key}.
417411
*
418-
* @param registryConsumer {@link Consumer} used to register a {@link Converter}
419-
* with the configured {@link ConverterRegistry}; never {@literal null}.
412+
* @param registryConsumer {@link Consumer} used to register a {@link Converter} with the configured
413+
* {@link ConverterRegistry}; never {@literal null}.
420414
* @throws IllegalStateException if {@link #getConversionService()} does not allow {@link Converter} registration.
421415
* @see org.springframework.core.convert.converter.ConverterRegistry
422416
* @since 2.2

0 commit comments

Comments
 (0)