クラス DefaultRedisScript<T>

java.lang.ObjectSE
org.springframework.data.redis.core.script.DefaultRedisScript<T>
型パラメーター:
T - スクリプトの結果型。Long、Boolean、List、逆直列化された値型のいずれかである必要があります。スクリプトが使い捨てステータスを返す場合は null になる可能性があります (つまり、"OK" )
実装されたすべてのインターフェース:
InitializingBeanRedisScript<T>

public class DefaultRedisScript<T> extends ObjectSE implements RedisScript<T>, InitializingBean
RedisScript のデフォルトの実装。基になる ScriptSource に委譲して、スクリプトテキストを取得し、スクリプトが変更されているかどうかを検出します(したがって、SHA1 を再計算する必要があります)。このクラスは、スクリプトの実行ごとに SHA1 が再計算されないようにするために、シングルトンとして使用するのが最適です。
作成者:
Jennifer Hickey, Christoph Strobl
  • コンストラクターの詳細

    • DefaultRedisScript

      public DefaultRedisScript()
      新しい DefaultRedisScript を作成します
    • DefaultRedisScript

      public DefaultRedisScript(StringSE script)
      新しい DefaultRedisScript を作成します
      パラメーター:
      script - null であってはなりません。
      導入:
      2.0
    • DefaultRedisScript

      public DefaultRedisScript(StringSE script, @Nullable ClassSE<T> resultType)
      新しい DefaultRedisScript を作成します
      パラメーター:
      script - null であってはなりません。
      resultType - null でもかまいません。
  • メソッドの詳細

    • afterPropertiesSet

      public void afterPropertiesSet()
      次で指定:
      インターフェース InitializingBeanafterPropertiesSet 
    • getSha1

      public StringSE getSha1()
      次で指定:
      インターフェース RedisScript<T>getSha1 
      戻り値:
      Redis evalsha コマンドの実行に使用されるスクリプトの SHA1。
    • getResultType

      @Nullable public ClassSE<T> getResultType()
      次で指定:
      インターフェース RedisScript<T>getResultType 
      戻り値:
      スクリプトの結果型。Long、Boolean、List、逆直列化された値型のいずれかである必要があります。スクリプトが使い捨てステータス(つまり "OK" )を返す場合は null。
    • getScriptAsString

      public StringSE getScriptAsString()
      次で指定:
      インターフェース RedisScript<T>getScriptAsString 
      戻り値:
      スクリプトの内容。
    • setResultType

      public void setResultType(@Nullable ClassSE<T> resultType)
      パラメーター:
      resultType - スクリプトの結果型。Long、Boolean、List、逆直列化された値型のいずれかである必要があります。スクリプトが使い捨てステータスを返す場合は null になる可能性があります (つまり、"OK" )
    • setScriptText

      public void setScriptText(StringSE scriptText)
      パラメーター:
      scriptText - スクリプトテキスト
    • setLocation

      public void setLocation(Resource scriptLocation)
      パラメーター:
      scriptLocation - スクリプトの場所
    • setScriptSource

      public void setScriptSource(ScriptSource scriptSource)
      パラメーター:
      scriptSource - スクリプトを指す @{link ScriptSource