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")public class DefaultRedisScript<T> extends Object implements RedisScript<T>, InitializingBean
RedisScript. Delegates to an underlying ScriptSource to retrieve script
text and detect if script has been modified (and thus should have SHA1 re-calculated). This class is best used as a
Singleton to avoid re-calculation of SHA1 on every script execution.| Constructor and Description |
|---|
DefaultRedisScript()
Creates a new
DefaultRedisScript |
DefaultRedisScript(String script,
Class<T> resultType)
Creates a new
DefaultRedisScript |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
Class<T> |
getResultType() |
String |
getScriptAsString() |
String |
getSha1() |
void |
setLocation(Resource scriptLocation) |
void |
setResultType(Class<T> resultType) |
void |
setScriptSource(ScriptSource scriptSource) |
void |
setScriptText(String scriptText) |
public DefaultRedisScript()
DefaultRedisScriptpublic DefaultRedisScript(String script, Class<T> resultType)
DefaultRedisScriptscript - resultType - public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic String getSha1()
getSha1 in interface RedisScript<T>public Class<T> getResultType()
getResultType in interface RedisScript<T>public String getScriptAsString()
getScriptAsString in interface RedisScript<T>public void setResultType(Class<T> resultType)
resultType - 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")public void setScriptText(String scriptText)
script - The script textpublic void setLocation(Resource scriptLocation)
scriptLocation - The location of the scriptpublic void setScriptSource(ScriptSource scriptSource)
scriptSource - A @{link ScriptSource pointing to the script