Skip to content

Commit c99e9cd

Browse files
committed
Edit and cleanup Javadoc.
Resolves spring-projects#2586
1 parent fa970ef commit c99e9cd

File tree

5 files changed

+135
-121
lines changed

5 files changed

+135
-121
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@
3838
import org.springframework.util.ReflectionUtils;
3939

4040
/**
41-
* {@link org.springframework.cache.Cache} implementation using for Redis as underlying store.
41+
* {@link org.springframework.cache.Cache} implementation using for Redis as the underlying store for cache data.
4242
* <p>
4343
* Use {@link RedisCacheManager} to create {@link RedisCache} instances.
4444
*
4545
* @author Christoph Strobl
4646
* @author Mark Paluch
4747
* @author Piotr Mionskowski
48+
* @author John Blum
4849
* @see RedisCacheConfiguration
4950
* @see RedisCacheWriter
5051
* @since 2.0
5152
*/
53+
@SuppressWarnings("unused")
5254
public class RedisCache extends AbstractValueAdaptingCache {
5355

5456
private static final byte[] BINARY_NULL_VALUE = RedisSerializer.java().serialize(NullValue.INSTANCE);
@@ -130,6 +132,7 @@ public <T> T get(Object key, Callable<T> valueLoader) {
130132
return getSynchronized(key, valueLoader);
131133
}
132134

135+
@Nullable
133136
@SuppressWarnings("unchecked")
134137
private synchronized <T> T getSynchronized(Object key, Callable<T> valueLoader) {
135138

@@ -396,5 +399,4 @@ private String prefixCacheKey(String key) {
396399
// allow contextual cache names by computing the key prefix on every call.
397400
return cacheConfig.getKeyPrefixFor(name) + key;
398401
}
399-
400402
}

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

+10-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
import org.springframework.util.Assert;
3333

3434
/**
35-
* Immutable {@link RedisCacheConfiguration} helps customizing {@link RedisCache} behaviour such as caching
36-
* {@literal null} values, cache key prefixes and binary serialization. <br />
37-
* Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behaviour from there
38-
* on.
35+
* Immutable {@link RedisCacheConfiguration} used to customize {@link RedisCache} behaviour, such as caching
36+
* {@literal null} values, computing cache key prefixes and handling binary serialization.
37+
* <p>
38+
* Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behaviour
39+
* from that point on.
3940
*
4041
* @author Christoph Strobl
4142
* @author Mark Paluch
43+
* @author John Blum
4244
* @since 2.0
4345
*/
4446
public class RedisCacheConfiguration {
@@ -358,7 +360,10 @@ public void configureKeyConverters(Consumer<ConverterRegistry> registryConsumer)
358360
}
359361

360362
/**
361-
* Registers default cache key converters. The following converters get registered:
363+
* Registers default cache {@link Converter key converters}.
364+
* <p>
365+
* The following converters get registered:
366+
* <p>
362367
* <ul>
363368
* <li>{@link String} to {@link byte byte[]} using UTF-8 encoding.</li>
364369
* <li>{@link SimpleKey} to {@link String}</li>

src/main/java/org/springframework/data/redis/connection/RedisCommands.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.springframework.lang.Nullable;
1919

2020
/**
21-
* Interface for the commands supported by Redis.
21+
* Interface defining the commands supported by Redis.
2222
*
2323
* @author Costin Leau
2424
* @author Christoph Strobl
@@ -29,14 +29,16 @@ public interface RedisCommands extends RedisKeyCommands, RedisStringCommands, Re
2929
RedisServerCommands, RedisStreamCommands, RedisScriptingCommands, RedisGeoCommands, RedisHyperLogLogCommands {
3030

3131
/**
32-
* 'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is,
33-
* with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or
34-
* the result.
32+
* {@literal Native} or {@literal raw} execution of the given Redis command along with the given arguments.
33+
* <p>
34+
* The command is executed as is, with as little interpretation as possible - it is up to the caller to take care
35+
* of any processing of arguments or the result.
3536
*
36-
* @param command Command to execute. must not be {@literal null}.
37-
* @param args Possible command arguments (may be empty).
38-
* @return execution result. Can be {@literal null}.
37+
* @param command Redis {@link String command} to execute; must not be {@literal null}.
38+
* @param args optional array of command arguments; may be empty;
39+
* @return the execution result; may be {@literal null}.
3940
*/
4041
@Nullable
4142
Object execute(String command, byte[]... args);
43+
4244
}

src/main/java/org/springframework/data/redis/core/RedisCallback.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@
2525
* {@code get/set/trim etc...}.
2626
*
2727
* @author Costin Leau
28+
* @author John Blum
2829
*/
2930
public interface RedisCallback<T> {
3031

3132
/**
32-
* Gets called by {@link RedisTemplate} with an active Redis connection. Does not need to care about activating or
33-
* closing the connection or handling exceptions.
33+
* Method called by {@link RedisTemplate} with an active {@link RedisConnection}.
34+
* <p>
35+
* Callback code need not care about activating/opening or closing the {@link RedisConnection},
36+
* nor handling {@link Exception exceptions}.
3437
*
35-
* @param connection active Redis connection
36-
* @return a result object or {@code null} if none
37-
* @throws DataAccessException
38+
* @param connection active {@link RedisConnection Redis connection}.
39+
* @return the {@link Object result} of the operation performed in the callback or {@code null}.
40+
* @throws DataAccessException if the operation performed by the callback fails to execute in the context of Redis
41+
* using the given {@link RedisConnection}.
3842
*/
3943
@Nullable
4044
T doInRedis(RedisConnection connection) throws DataAccessException;
45+
4146
}

0 commit comments

Comments
 (0)