Module spring.data.redis
Interface RedisScript<T>
- Type Parameters:
T- The script result type. Should be one of Long, Boolean, List, or deserialized value type. Can be null if the script returns a throw-away status (i.e "OK")
- All Known Implementing Classes:
DefaultRedisScript
public interface RedisScript<T>
A script to be executed using the Redis scripting support available as
of version 2.6
- Author:
- Jennifer Hickey, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiongetSha1()static <T> RedisScript<T>static <T> RedisScript<T>static <T> RedisScript<T>Creates newRedisScript(with throw away result) from the givenResource.static <T> RedisScript<T>Creates newRedisScriptfromResource.default boolean
-
Method Details
-
getSha1
String getSha1()- Returns:
- The SHA1 of the script, used for executing Redis evalsha command.
-
getResultType
- Returns:
- The script result type. Should be one of Long, Boolean, List, or deserialized value type. null if the script returns a throw-away status (i.e "OK").
-
getScriptAsString
String getScriptAsString()- Returns:
- The script contents.
-
returnsRawValue
default boolean returnsRawValue()- Returns:
- true if result type is null and does not need any further deserialization.
- Since:
- 2.0
-
of
- Parameters:
script- must not be null.- Returns:
- new instance of
RedisScript. - Since:
- 2.0
-
of
- Parameters:
script- must not be null.resultType- must not be null.- Returns:
- new instance of
RedisScript. - Since:
- 2.0
-
of
Creates newRedisScript(with throw away result) from the givenResource.- Parameters:
resource- must not be null.- Returns:
- new instance of
RedisScript. - Throws:
IllegalArgumentException- if the required argument is null.- Since:
- 2.2
-
of
Creates newRedisScriptfromResource.- Parameters:
resource- must not be null.resultType- must not be null.- Returns:
- new instance of
RedisScript. - Throws:
IllegalArgumentException- if any required argument is null.- Since:
- 2.2
-