Interface ReactiveValueOperations<K,V>


public interface ReactiveValueOperations<K,V>
Reactive Redis operations for simple (or in Redis terminology 'string') values.

Streams of methods returning Mono<K> or Flux<M> are terminated with InvalidDataAccessApiUsageException when RedisElementReader.read(ByteBuffer) returns null for a particular element as Reactive Streams prohibit the usage of null values.

Since:
2.0
Author:
Mark Paluch, Jiahe Cai
  • Method Details

    • set

      Mono<Boolean> set(K key, V value)
      Set value for key.
      Parameters:
      key - must not be null.
      value -
      See Also:
    • set

      Mono<Boolean> set(K key, V value, Duration timeout)
      Set the value and expiration timeout for key.
      Parameters:
      key - must not be null.
      value -
      timeout - must not be null.
      See Also:
    • setGet

      Mono<V> setGet(K key, V value, Duration timeout)
      Set the value and expiration timeout for key. Return the old string stored at key, or empty if key did not exist. An error is returned and SET aborted if the value stored at key is not a string.
      Parameters:
      key - must not be null.
      value -
      timeout - must not be null.
      Since:
      3.5
      See Also:
    • setIfAbsent

      Mono<Boolean> setIfAbsent(K key, V value)
      Set key to hold the string value if key is absent.
      Parameters:
      key - must not be null.
      value -
      See Also:
    • setIfAbsent

      Mono<Boolean> setIfAbsent(K key, V value, Duration timeout)
      Set key to hold the string value and expiration timeout if key is absent.
      Parameters:
      key - must not be null.
      value -
      timeout - must not be null.
      Since:
      2.1
      See Also:
    • setIfPresent

      Mono<Boolean> setIfPresent(K key, V value)
      Set key to hold the string value if key is present.
      Parameters:
      key - must not be null.
      value -
      See Also:
    • setIfPresent

      Mono<Boolean> setIfPresent(K key, V value, Duration timeout)
      Set key to hold the string value and expiration timeout if key is present.
      Parameters:
      key - must not be null.
      value -
      timeout - must not be null.
      Since:
      2.1
      See Also:
    • multiSet

      Mono<Boolean> multiSet(Map<? extends K,? extends V> map)
      Set multiple keys to multiple values using key-value pairs provided in tuple.
      Parameters:
      map - must not be null.
      See Also:
    • multiSetIfAbsent

      Mono<Boolean> multiSetIfAbsent(Map<? extends K,? extends V> map)
      Set multiple keys to multiple values using key-value pairs provided in tuple only if the provided key does not exist.
      Parameters:
      map - must not be null.
      See Also:
    • get

      Mono<V> get(Object key)
      Get the value of key.
      Parameters:
      key - must not be null.
      See Also:
    • getAndDelete

      Mono<V> getAndDelete(K key)
      Return the value at key and delete the key.
      Parameters:
      key - must not be null.
      Since:
      2.6
      See Also:
    • getAndExpire

      Mono<V> getAndExpire(K key, Duration timeout)
      Return the value at key and expire the key by applying timeout.
      Parameters:
      key - must not be null.
      timeout - must not be null.
      Since:
      2.6
      See Also:
    • getAndPersist

      Mono<V> getAndPersist(K key)
      Return the value at key and persist the key. This operation removes any TTL that is associated with key.
      Parameters:
      key - must not be null.
      Since:
      2.6
      See Also:
    • getAndSet

      Mono<V> getAndSet(K key, V value)
      Set value of key and return its old value.
      Parameters:
      key - must not be null.
      See Also:
    • multiGet

      Mono<List<V>> multiGet(Collection<K> keys)
      Get multiple keys. Values are in the order of the requested keys. Absent field values are represented using null in the resulting List.
      Parameters:
      keys - must not be null.
      See Also:
    • increment

      Mono<Long> increment(K key)
      Increments the number stored at key by one.
      Parameters:
      key - must not be null.
      Since:
      2.1
      See Also:
    • increment

      Mono<Long> increment(K key, long delta)
      Increments the number stored at key by delta.
      Parameters:
      key - must not be null.
      delta -
      Since:
      2.1
      See Also:
    • increment

      Mono<Double> increment(K key, double delta)
      Increment the string representing a floating point number stored at key by delta.
      Parameters:
      key - must not be null.
      delta -
      Since:
      2.1
      See Also:
    • decrement

      Mono<Long> decrement(K key)
      Decrements the number stored at key by one.
      Parameters:
      key - must not be null.
      Since:
      2.1
      See Also:
    • decrement

      Mono<Long> decrement(K key, long delta)
      Decrements the number stored at key by delta.
      Parameters:
      key - must not be null.
      delta -
      Since:
      2.1
      See Also:
    • append

      Mono<Long> append(K key, String value)
      Append a value to key.
      Parameters:
      key - must not be null.
      value -
      See Also:
    • get

      Mono<String> get(K key, long start, long end)
      Get a substring of value of key between begin and end.
      Parameters:
      key - must not be null.
      start -
      end -
      See Also:
    • set

      Mono<Long> set(K key, V value, long offset)
      Overwrite parts of key starting at the specified offset with given value.
      Parameters:
      key - must not be null.
      value -
      offset -
      See Also:
    • size

      Mono<Long> size(K key)
      Get the length of the value stored at key.
      Parameters:
      key - must not be null.
      See Also:
    • setBit

      Mono<Boolean> setBit(K key, long offset, boolean value)
      Sets the bit at offset in value stored at key.
      Parameters:
      key - must not be null.
      offset -
      value -
      See Also:
    • getBit

      Mono<Boolean> getBit(K key, long offset)
      « Get the bit value at offset of value at key.
      Parameters:
      key - must not be null.
      offset -
      See Also:
    • bitField

      Mono<List<Long>> bitField(K key, BitFieldSubCommands command)
      Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a given key.
      Parameters:
      key - must not be null.
      command - must not be null.
      Returns:
      Since:
      2.1
      See Also:
    • delete

      Mono<Boolean> delete(K key)
      Removes the given key.
      Parameters:
      key - must not be null.
      See Also: