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)
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, of, of, of, returnsRawValuepublic DefaultRedisScript()
DefaultRedisScriptpublic DefaultRedisScript(String script)
DefaultRedisScriptscript - must not be null.public DefaultRedisScript(String script, @Nullable Class<T> resultType)
DefaultRedisScriptscript - must not be null.resultType - can be null.public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanpublic String getSha1()
getSha1 in interface RedisScript<T>@Nullable public Class<T> getResultType()
getResultType in interface RedisScript<T>public String getScriptAsString()
getScriptAsString in interface RedisScript<T>public void setResultType(@Nullable 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)
scriptText - The script textpublic void setLocation(Resource scriptLocation)
scriptLocation - The location of the scriptpublic void setScriptSource(ScriptSource scriptSource)
scriptSource - A @{link ScriptSource pointing to the scriptCopyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.