Skip to content

Commit 943bb8f

Browse files
committed
Fix Scripting Documentation for imperative Lua scripts.
See #3010
1 parent d1e4fa0 commit 943bb8f

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/main/antora/modules/ROOT/pages/redis/scripting.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class Example {
3434
RedisScript<Boolean> script;
3535
3636
public boolean checkAndSet(String expectedValue, String newValue) {
37-
return redisOperations.execute(script, singletonList("key"), asList(expectedValue, newValue));
37+
return redisOperations.execute(script, singletonList("key"), expectedValue, newValue);
3838
}
3939
}
4040
----

src/main/java/org/springframework/data/redis/core/script/ReactiveScriptExecutor.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
* <p>
3131
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
3232
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
33-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
34-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
33+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
34+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
3535
*
3636
* @author Mark Paluch
3737
* @author Christoph Strobl
@@ -45,7 +45,7 @@ public interface ReactiveScriptExecutor<K> {
4545
*
4646
* @param script must not be {@literal null}.
4747
* @return the return value of the script or {@link Flux#empty()} if {@link RedisScript#getResultType()} is
48-
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
48+
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK").
4949
*/
5050
default <T> Flux<T> execute(RedisScript<T> script) {
5151
return execute(script, Collections.emptyList());
@@ -57,7 +57,7 @@ default <T> Flux<T> execute(RedisScript<T> script) {
5757
* @param script must not be {@literal null}.
5858
* @param keys must not be {@literal null}.
5959
* @return the return value of the script or {@link Flux#empty()} if {@link RedisScript#getResultType()} is
60-
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
60+
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK").
6161
*/
6262
default <T> Flux<T> execute(RedisScript<T> script, List<K> keys) {
6363
return execute(script, keys, Collections.emptyList());
@@ -67,8 +67,8 @@ default <T> Flux<T> execute(RedisScript<T> script, List<K> keys) {
6767
* Executes the given {@link RedisScript}
6868
*
6969
* @param script The script to execute. Must not be {@literal null}.
70-
* @param keys Any keys that need to be passed to the script. Must not be {@literal null}.
71-
* @param args Any args that need to be passed to the script. Can be {@literal empty}.
70+
* @param keys any keys that need to be passed to the script. Must not be {@literal null}.
71+
* @param args any args that need to be passed to the script. Can be {@literal empty}.
7272
* @return The return value of the script or {@link Flux#empty()} if {@link RedisScript#getResultType()} is
7373
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
7474
*/
@@ -79,8 +79,8 @@ default <T> Flux<T> execute(RedisScript<T> script, List<K> keys) {
7979
* arguments and result.
8080
*
8181
* @param script The script to execute. must not be {@literal null}.
82-
* @param keys Any keys that need to be passed to the script
83-
* @param args Any args that need to be passed to the script
82+
* @param keys any keys that need to be passed to the script.
83+
* @param args any args that need to be passed to the script.
8484
* @param argsWriter The {@link RedisElementWriter} to use for serializing args. Must not be {@literal null}.
8585
* @param resultReader The {@link RedisElementReader} to use for serializing the script return value. Must not be
8686
* {@literal null}.

src/main/java/org/springframework/data/redis/core/script/ScriptExecutor.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ public interface ScriptExecutor<K> {
3030
/**
3131
* Executes the given {@link RedisScript}
3232
*
33-
* @param script The script to execute
34-
* @param keys Any keys that need to be passed to the script
35-
* @param args Any args that need to be passed to the script
36-
* @return The return value of the script or null if {@link RedisScript#getResultType()} is null, likely indicating a
37-
* throw-away status reply (i.e. "OK")
33+
* @param script the script to execute.
34+
* @param keys any keys that need to be passed to the script.
35+
* @param args any args that need to be passed to the script.
36+
* @return The return value of the script or {@literal null} if {@link RedisScript#getResultType()} is
37+
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK").
3838
*/
3939
<T> T execute(RedisScript<T> script, List<K> keys, Object... args);
4040

4141
/**
4242
* Executes the given {@link RedisScript}, using the provided {@link RedisSerializer}s to serialize the script
4343
* arguments and result.
4444
*
45-
* @param script The script to execute
46-
* @param argsSerializer The {@link RedisSerializer} to use for serializing args
47-
* @param resultSerializer The {@link RedisSerializer} to use for serializing the script return value
48-
* @param keys Any keys that need to be passed to the script
49-
* @param args Any args that need to be passed to the script
50-
* @return The return value of the script or null if {@link RedisScript#getResultType()} is null, likely indicating a
51-
* throw-away status reply (i.e. "OK")
45+
* @param script the script to execute.
46+
* @param argsSerializer The {@link RedisSerializer} to use for serializing args.
47+
* @param resultSerializer The {@link RedisSerializer} to use for serializing the script return value.
48+
* @param keys any keys that need to be passed to the script.
49+
* @param args any args that need to be passed to the script.
50+
* @return The return value of the script or {@literal null} if {@link RedisScript#getResultType()} is
51+
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK").
5252
*/
5353
<T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSerializer<T> resultSerializer,
5454
List<K> keys, Object... args);

0 commit comments

Comments
 (0)