Interface RJsonBucketAsync<V>

Type Parameters:
V - the type of object
All Superinterfaces:
RBucketAsync<V>, RExpirableAsync, RObjectAsync
All Known Subinterfaces:
RJsonBucket<V>
All Known Implementing Classes:
RedissonJsonBucket

public interface RJsonBucketAsync<V> extends RBucketAsync<V>
Redis JSON datatype interface. Data is stored as JSON object in Redis
Author:
Nikita Koksharov
  • Method Details

    • getAsync

      <T> RFuture<T> getAsync(JsonCodec<T> codec, String... paths)
      Get Json object/objects by JSONPath
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      paths - JSON paths
      Returns:
      object
    • setIfAbsentAsync

      RFuture<Boolean> setIfAbsentAsync(String path, Object value)
      Sets Json object by JSONPath only if previous value is empty
      Parameters:
      path - JSON path
      value - object
      Returns:
      true if successful, or false if value was already set
    • trySetAsync

      @Deprecated RFuture<Boolean> trySetAsync(String path, Object value)
      Deprecated.
      Parameters:
      path - JSON path
      value - object
      Returns:
      true if successful, or false if value was already set
    • setIfExistsAsync

      RFuture<Boolean> setIfExistsAsync(String path, Object value)
      Sets Json object by JSONPath only if previous value is non-empty
      Parameters:
      path - JSON path
      value - object
      Returns:
      true if successful, or false if element wasn't set
    • compareAndSetAsync

      RFuture<Boolean> compareAndSetAsync(String path, Object expect, Object update)
      Atomically sets the value to the given updated value by given JSONPath, only if serialized state of the current value equals to serialized state of the expected value.
      Parameters:
      path - JSON path
      expect - the expected value
      update - the new value
      Returns:
      true if successful; or false if the actual value was not equal to the expected value.
    • getAndSetAsync

      <T> RFuture<T> getAndSetAsync(JsonCodec<T> codec, String path, Object newValue)
      Retrieves current value of element specified by JSONPath and replaces it with newValue.
      Parameters:
      codec - object codec
      path - JSON path
      newValue - value to set
      Returns:
      previous value
    • setAsync

      RFuture<Void> setAsync(String path, Object value)
      Stores object into element by specified JSONPath.
      Parameters:
      path - JSON path
      value - value to set
      Returns:
      void
    • stringSizeAsync

      RFuture<Long> stringSizeAsync(String path)
      Returns size of string data by JSONPath
      Parameters:
      path - JSON path
      Returns:
      size of string
    • stringSizeMultiAsync

      RFuture<List<Long>> stringSizeMultiAsync(String path)
      Returns list of string data size by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      list of string data sizes
    • stringAppendAsync

      RFuture<Long> stringAppendAsync(String path, Object value)
      Appends string data to element specified by JSONPath. Returns new size of string data.
      Parameters:
      path - JSON path
      value - data
      Returns:
      size of string data
    • stringAppendMultiAsync

      RFuture<List<Long>> stringAppendMultiAsync(String path, Object value)
      Appends string data to elements specified by JSONPath. Returns new size of string data. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - data
      Returns:
      list of string data sizes
    • arrayAppendAsync

      RFuture<Long> arrayAppendAsync(String path, Object... values)
      Appends values to array specified by JSONPath. Returns new size of array.
      Parameters:
      path - JSON path
      values - values to append
      Returns:
      size of array
    • arrayAppendMultiAsync

      RFuture<List<Long>> arrayAppendMultiAsync(String path, Object... values)
      Appends values to arrays specified by JSONPath. Returns new size of arrays. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      values - values to append
      Returns:
      list of arrays size
    • arrayIndexAsync

      RFuture<Long> arrayIndexAsync(String path, Object value)
      Returns index of object in array specified by JSONPath. -1 means object not found.
      Parameters:
      path - JSON path
      value - value to search
      Returns:
      index in array
    • arrayIndexMultiAsync

      RFuture<List<Long>> arrayIndexMultiAsync(String path, Object value)
      Returns index of object in arrays specified by JSONPath. -1 means object not found. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - value to search
      Returns:
      list of index in arrays
    • arrayIndexAsync

      RFuture<Long> arrayIndexAsync(String path, Object value, long start, long end)
      Returns index of object in array specified by JSONPath in range between start (inclusive) and end (exclusive) indexes. -1 means object not found.
      Parameters:
      path - JSON path
      value - value to search
      start - start index, inclusive
      end - end index, exclusive
      Returns:
      index in array
    • arrayIndexMultiAsync

      RFuture<List<Long>> arrayIndexMultiAsync(String path, Object value, long start, long end)
      Returns index of object in arrays specified by JSONPath in range between start (inclusive) and end (exclusive) indexes. -1 means object not found. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - value to search
      start - start index, inclusive
      end - end index, exclusive
      Returns:
      list of index in arrays
    • arrayInsertAsync

      RFuture<Long> arrayInsertAsync(String path, long index, Object... values)
      Inserts values into array specified by JSONPath. Values are inserted at defined index.
      Parameters:
      path - JSON path
      index - array index at which values are inserted
      values - values to insert
      Returns:
      size of array
    • arrayInsertMultiAsync

      RFuture<List<Long>> arrayInsertMultiAsync(String path, long index, Object... values)
      Inserts values into arrays specified by JSONPath. Values are inserted at defined index. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      index - array index at which values are inserted
      values - values to insert
      Returns:
      list of arrays size
    • arraySizeAsync

      RFuture<Long> arraySizeAsync(String path)
      Returns size of array specified by JSONPath.
      Parameters:
      path - JSON path
      Returns:
      size of array
    • arraySizeMultiAsync

      RFuture<List<Long>> arraySizeMultiAsync(String path)
      Returns size of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      list of arrays size
    • arrayPollLastAsync

      <T> RFuture<T> arrayPollLastAsync(JsonCodec<T> codec, String path)
      Polls last element of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      last element
    • arrayPollLastMultiAsync

      <T> RFuture<List<T>> arrayPollLastMultiAsync(JsonCodec<T> codec, String path)
      Polls last element of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      list of last elements
    • arrayPollFirstAsync

      <T> RFuture<T> arrayPollFirstAsync(JsonCodec<T> codec, String path)
      Polls first element of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      first element
    • arrayPollFirstMultiAsync

      <T> RFuture<List<T>> arrayPollFirstMultiAsync(JsonCodec<T> codec, String path)
      Polls first element of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      list of first elements
    • arrayPopAsync

      <T> RFuture<T> arrayPopAsync(JsonCodec<T> codec, String path, long index)
      Pops element located at index of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      index - array index
      Returns:
      element
    • arrayPopMultiAsync

      <T> RFuture<List<T>> arrayPopMultiAsync(JsonCodec<T> codec, String path, long index)
      Pops elements located at index of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      index - array index
      Returns:
      list of elements
    • arrayTrimAsync

      RFuture<Long> arrayTrimAsync(String path, long start, long end)
      Trims array specified by JSONPath in range between start (inclusive) and end (inclusive) indexes.
      Parameters:
      path - JSON path
      start - start index, inclusive
      end - end index, inclusive
      Returns:
      length of array
    • arrayTrimMultiAsync

      RFuture<List<Long>> arrayTrimMultiAsync(String path, long start, long end)
      Trims arrays specified by JSONPath in range between start (inclusive) and end (inclusive) indexes. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      start - start index, inclusive
      end - end index, inclusive
      Returns:
      length of array
    • clearAsync

      RFuture<Long> clearAsync()
      Clears json container.
      Returns:
      number of cleared containers
    • clearAsync

      RFuture<Long> clearAsync(String path)
      Clears json container specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      number of cleared containers
    • incrementAndGetAsync

      <T extends Number> RFuture<T> incrementAndGetAsync(String path, T delta)
      Increments the current value specified by JSONPath by delta.
      Parameters:
      path - JSON path
      delta - increment value
      Returns:
      the updated value
    • incrementAndGetMultiAsync

      <T extends Number> RFuture<List<T>> incrementAndGetMultiAsync(String path, T delta)
      Increments the current values specified by JSONPath by delta. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      delta - increment value
      Returns:
      list of updated value
    • countKeysAsync

      RFuture<Long> countKeysAsync()
      Returns keys amount in JSON container
      Returns:
      keys amount
    • countKeysAsync

      RFuture<Long> countKeysAsync(String path)
      Returns keys amount in JSON container specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      keys amount
    • countKeysMultiAsync

      RFuture<List<Long>> countKeysMultiAsync(String path)
      Returns list of keys amount in JSON containers specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys amount
    • getKeysAsync

      RFuture<List<String>> getKeysAsync()
      Returns list of keys in JSON container
      Returns:
      list of keys
    • getKeysAsync

      RFuture<List<String>> getKeysAsync(String path)
      Returns list of keys in JSON container specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys
    • getKeysMultiAsync

      RFuture<List<List<String>>> getKeysMultiAsync(String path)
      Returns list of keys in JSON containers specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys
    • toggleAsync

      RFuture<Boolean> toggleAsync(String path)
      Toggle boolean value specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      new boolean value
    • toggleMultiAsync

      RFuture<List<Boolean>> toggleMultiAsync(String path)
      Toggle boolean values specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of boolean values
    • getTypeAsync

      RFuture<JsonType> getTypeAsync()
      Returns type of element
      Returns:
      type of element
    • getTypeAsync

      RFuture<JsonType> getTypeAsync(String path)
      Returns type of element specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      type of element
    • deleteAsync

      RFuture<Long> deleteAsync(String path)
      Deletes JSON elements specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      number of deleted elements