Module lettuce.core

Interface RedisStringReactiveCommands<K,​V>

Type Parameters:
K - Key type.
V - Value type.
All Known Subinterfaces:
RedisAdvancedClusterReactiveCommands<K,​V>, RedisClusterPubSubReactiveCommands<K,​V>, RedisClusterReactiveCommands<K,​V>, RedisPubSubReactiveCommands<K,​V>, RedisReactiveCommands<K,​V>
All Known Implementing Classes:
AbstractRedisReactiveCommands, RedisAdvancedClusterReactiveCommandsImpl, RedisClusterPubSubReactiveCommandsImpl, RedisPubSubReactiveCommandsImpl, RedisReactiveCommandsImpl, RedisSentinelReactiveCommandsImpl

public interface RedisStringReactiveCommands<K,​V>
Reactive executed commands for Strings.
Since:
4.0
Author:
Mark Paluch
Generated class:
by io.lettuce.apigenerator.CreateReactiveApi
  • Method Summary

    Modifier and Type Method Description
    Mono<Long> append​(K key, V value)
    Append a value to a key.
    Mono<Long> bitcount​(K key)
    Count set bits in a string.
    Mono<Long> bitcount​(K key, long start, long end)
    Count set bits in a string.
    Flux<Value<Long>> bitfield​(K key, BitFieldArgs bitFieldArgs)
    Execute BITFIELD with its subcommands.
    Mono<Long> bitopAnd​(K destination, K... keys)
    Perform bitwise AND between strings.
    Mono<Long> bitopNot​(K destination, K source)
    Perform bitwise NOT between strings.
    Mono<Long> bitopOr​(K destination, K... keys)
    Perform bitwise OR between strings.
    Mono<Long> bitopXor​(K destination, K... keys)
    Perform bitwise XOR between strings.
    Mono<Long> bitpos​(K key, boolean state)
    Find first bit set or clear in a string.
    Mono<Long> bitpos​(K key, boolean state, long start)
    Find first bit set or clear in a string.
    Mono<Long> bitpos​(K key, boolean state, long start, long end)
    Find first bit set or clear in a string.
    Mono<Long> decr​(K key)
    Decrement the integer value of a key by one.
    Mono<Long> decrby​(K key, long amount)
    Decrement the integer value of a key by the given number.
    Mono<V> get​(K key)
    Get the value of a key.
    Mono<Long> getbit​(K key, long offset)
    Returns the bit value at offset in the string value stored at key.
    Mono<V> getdel​(K key)
    Get the value of key and delete the key.
    Mono<V> getex​(K key, GetExArgs args)
    Get the value of key and optionally set its expiration.
    Mono<V> getrange​(K key, long start, long end)
    Get a substring of the string stored at a key.
    Mono<V> getset​(K key, V value)
    Set the string value of a key and return its old value.
    Mono<Long> incr​(K key)
    Increment the integer value of a key by one.
    Mono<Long> incrby​(K key, long amount)
    Increment the integer value of a key by the given amount.
    Mono<Double> incrbyfloat​(K key, double amount)
    Increment the float value of a key by the given amount.
    Mono<Long> mget​(KeyValueStreamingChannel<K,​V> channel, K... keys)
    Deprecated.
    since 6.0 in favor of consuming large results through the Publisher returned by mget(K...).
    Flux<KeyValue<K,​V>> mget​(K... keys)
    Get the values of all the given keys.
    Mono<String> mset​(Map<K,​V> map)
    Set multiple keys to multiple values.
    Mono<Boolean> msetnx​(Map<K,​V> map)
    Set multiple keys to multiple values, only if none of the keys exist.
    Mono<String> psetex​(K key, long milliseconds, V value)
    Set the value and expiration in milliseconds of a key.
    Mono<String> set​(K key, V value)
    Set the string value of a key.
    Mono<String> set​(K key, V value, SetArgs setArgs)
    Set the string value of a key.
    Mono<Long> setbit​(K key, long offset, int value)
    Sets or clears the bit at offset in the string value stored at key.
    Mono<String> setex​(K key, long seconds, V value)
    Set the value and expiration of a key.
    Mono<V> setGet​(K key, V value)
    Set the string value of a key and return its old value.
    Mono<V> setGet​(K key, V value, SetArgs setArgs)
    Set the string value of a key and return its old value.
    Mono<Boolean> setnx​(K key, V value)
    Set the value of a key, only if the key does not exist.
    Mono<Long> setrange​(K key, long offset, V value)
    Overwrite part of a string at key starting at the specified offset.
    Mono<StringMatchResult> stralgoLcs​(StrAlgoArgs strAlgoArgs)
    The STRALGO command implements complex algorithms that operate on strings.
    Mono<Long> strlen​(K key)
    Get the length of the value stored in a key.
  • Method Details

    • append

      Mono<Long> append​(K key, V value)
      Append a value to a key.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      Long integer-reply the length of the string after the append operation.
    • bitcount

      Mono<Long> bitcount​(K key)
      Count set bits in a string.
      Parameters:
      key - the key.
      Returns:
      Long integer-reply The number of bits set to 1.
    • bitcount

      Mono<Long> bitcount​(K key, long start, long end)
      Count set bits in a string.
      Parameters:
      key - the key.
      start - the start.
      end - the end.
      Returns:
      Long integer-reply The number of bits set to 1.
    • bitfield

      Flux<Value<Long>> bitfield​(K key, BitFieldArgs bitFieldArgs)
      Execute BITFIELD with its subcommands.
      Parameters:
      key - the key.
      bitFieldArgs - the args containing subcommands, must not be null.
      Returns:
      Long bulk-reply the results from the bitfield commands.
    • bitpos

      Mono<Long> bitpos​(K key, boolean state)
      Find first bit set or clear in a string.
      Parameters:
      key - the key.
      state - the state.
      Returns:
      Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only.
    • bitpos

      Mono<Long> bitpos​(K key, boolean state, long start)
      Find first bit set or clear in a string.
      Parameters:
      key - the key.
      state - the bit type: long.
      start - the start type: long.
      Returns:
      Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only.
      Since:
      5.0.1
    • bitpos

      Mono<Long> bitpos​(K key, boolean state, long start, long end)
      Find first bit set or clear in a string.
      Parameters:
      key - the key.
      state - the bit type: long.
      start - the start type: long.
      end - the end type: long.
      Returns:
      Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only. However this behavior changes if you are looking for clear bits and specify a range with both start and end. If no clear bit is found in the specified range, the function returns -1 as the user specified a clear range and there are no 0 bits in that range.
    • bitopAnd

      Mono<Long> bitopAnd​(K destination, K... keys)
      Perform bitwise AND between strings.
      Parameters:
      destination - result key of the operation.
      keys - operation input key names.
      Returns:
      Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
    • bitopNot

      Mono<Long> bitopNot​(K destination, K source)
      Perform bitwise NOT between strings.
      Parameters:
      destination - result key of the operation.
      source - operation input key names.
      Returns:
      Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
    • bitopOr

      Mono<Long> bitopOr​(K destination, K... keys)
      Perform bitwise OR between strings.
      Parameters:
      destination - result key of the operation.
      keys - operation input key names.
      Returns:
      Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
    • bitopXor

      Mono<Long> bitopXor​(K destination, K... keys)
      Perform bitwise XOR between strings.
      Parameters:
      destination - result key of the operation.
      keys - operation input key names.
      Returns:
      Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
    • decr

      Mono<Long> decr​(K key)
      Decrement the integer value of a key by one.
      Parameters:
      key - the key.
      Returns:
      Long integer-reply the value of key after the decrement.
    • decrby

      Mono<Long> decrby​(K key, long amount)
      Decrement the integer value of a key by the given number.
      Parameters:
      key - the key.
      amount - the decrement type: long.
      Returns:
      Long integer-reply the value of key after the decrement.
    • get

      Mono<V> get​(K key)
      Get the value of a key.
      Parameters:
      key - the key.
      Returns:
      V bulk-string-reply the value of key, or null when key does not exist.
    • getbit

      Mono<Long> getbit​(K key, long offset)
      Returns the bit value at offset in the string value stored at key.
      Parameters:
      key - the key.
      offset - the offset type: long.
      Returns:
      Long integer-reply the bit value stored at offset.
    • getdel

      Mono<V> getdel​(K key)
      Get the value of key and delete the key.
      Parameters:
      key - the key.
      Returns:
      V bulk-string-reply the value of key, or null when key does not exist.
      Since:
      6.1
    • getex

      Mono<V> getex​(K key, GetExArgs args)
      Get the value of key and optionally set its expiration.
      Parameters:
      key - the key.
      args - the arguments for GETEX.
      Returns:
      V bulk-string-reply the value of key, or null when key does not exist.
      Since:
      6.1
    • getrange

      Mono<V> getrange​(K key, long start, long end)
      Get a substring of the string stored at a key.
      Parameters:
      key - the key.
      start - the start type: long.
      end - the end type: long.
      Returns:
      V bulk-string-reply.
    • getset

      Mono<V> getset​(K key, V value)
      Set the string value of a key and return its old value.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      V bulk-string-reply the old value stored at key, or null when key did not exist.
    • incr

      Mono<Long> incr​(K key)
      Increment the integer value of a key by one.
      Parameters:
      key - the key.
      Returns:
      Long integer-reply the value of key after the increment.
    • incrby

      Mono<Long> incrby​(K key, long amount)
      Increment the integer value of a key by the given amount.
      Parameters:
      key - the key.
      amount - the increment type: long.
      Returns:
      Long integer-reply the value of key after the increment.
    • incrbyfloat

      Mono<Double> incrbyfloat​(K key, double amount)
      Increment the float value of a key by the given amount.
      Parameters:
      key - the key.
      amount - the increment type: double.
      Returns:
      Double bulk-string-reply the value of key after the increment.
    • mget

      Flux<KeyValue<K,​V>> mget​(K... keys)
      Get the values of all the given keys.
      Parameters:
      keys - the key.
      Returns:
      V array-reply list of values at the specified keys.
    • mget

      @Deprecated Mono<Long> mget​(KeyValueStreamingChannel<K,​V> channel, K... keys)
      Deprecated.
      since 6.0 in favor of consuming large results through the Publisher returned by mget(K...).
      Stream over the values of all the given keys.
      Parameters:
      channel - the channel.
      keys - the keys.
      Returns:
      Long array-reply list of values at the specified keys.
    • mset

      Mono<String> mset​(Map<K,​V> map)
      Set multiple keys to multiple values.
      Parameters:
      map - the null.
      Returns:
      String simple-string-reply always OK since MSET can't fail.
    • msetnx

      Mono<Boolean> msetnx​(Map<K,​V> map)
      Set multiple keys to multiple values, only if none of the keys exist.
      Parameters:
      map - the null.
      Returns:
      Boolean integer-reply specifically: 1 if the all the keys were set. 0 if no key was set (at least one key already existed).
    • set

      Mono<String> set​(K key, V value)
      Set the string value of a key.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      String simple-string-reply OK if SET was executed correctly.
    • set

      Mono<String> set​(K key, V value, SetArgs setArgs)
      Set the string value of a key.
      Parameters:
      key - the key.
      value - the value.
      setArgs - the setArgs.
      Returns:
      String simple-string-reply OK if SET was executed correctly.
    • setGet

      Mono<V> setGet​(K key, V value)
      Set the string value of a key and return its old value.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      V bulk-string-reply the old value stored at key, or null when key did not exist.
      Since:
      6.1
    • setGet

      Mono<V> setGet​(K key, V value, SetArgs setArgs)
      Set the string value of a key and return its old value.
      Parameters:
      key - the key.
      value - the value.
      setArgs - the command arguments.
      Returns:
      V bulk-string-reply the old value stored at key, or null when key did not exist.
      Since:
      6.1
    • setbit

      Mono<Long> setbit​(K key, long offset, int value)
      Sets or clears the bit at offset in the string value stored at key.
      Parameters:
      key - the key.
      offset - the offset type: long.
      value - the value type: string.
      Returns:
      Long integer-reply the original bit value stored at offset.
    • setex

      Mono<String> setex​(K key, long seconds, V value)
      Set the value and expiration of a key.
      Parameters:
      key - the key.
      seconds - the seconds type: long.
      value - the value.
      Returns:
      String simple-string-reply.
    • psetex

      Mono<String> psetex​(K key, long milliseconds, V value)
      Set the value and expiration in milliseconds of a key.
      Parameters:
      key - the key.
      milliseconds - the milliseconds type: long.
      value - the value.
      Returns:
      String simple-string-reply.
    • setnx

      Mono<Boolean> setnx​(K key, V value)
      Set the value of a key, only if the key does not exist.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      Boolean integer-reply specifically: 1 if the key was set 0 if the key was not set.
    • setrange

      Mono<Long> setrange​(K key, long offset, V value)
      Overwrite part of a string at key starting at the specified offset.
      Parameters:
      key - the key.
      offset - the offset type: long.
      value - the value.
      Returns:
      Long integer-reply the length of the string after it was modified by the command.
    • stralgoLcs

      Mono<StringMatchResult> stralgoLcs​(StrAlgoArgs strAlgoArgs)
      The STRALGO command implements complex algorithms that operate on strings. This method uses the LCS algorithm (longest common substring).
      • Without modifiers the string representing the longest common substring is returned.
      • When LEN is given the command returns the length of the longest common substring.
      • When IDX is given the command returns an array with the LCS length and all the ranges in both the strings, start and end offset for each string, where there are matches. When WITHMATCHLEN is given each array representing a match will also have the length of the match.
      Parameters:
      strAlgoArgs - command arguments.
      Returns:
      StringMatchResult.
      Since:
      6.0
    • strlen

      Mono<Long> strlen​(K key)
      Get the length of the value stored in a key.
      Parameters:
      key - the key.
      Returns:
      Long integer-reply the length of the string at key, or 0 when key does not exist.