Package org.redisson.api
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
Redis JSON datatype interface. Data is stored as JSON object in Redis
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionarrayAppendAsync
(String path, Object... values) Appends values to array specified by JSONPath.arrayAppendMultiAsync
(String path, Object... values) Appends values to arrays specified by JSONPath.arrayIndexAsync
(String path, Object value) Returns index of object in array specified by JSONPatharrayIndexAsync
(String path, Object value, long start, long end) Returns index of object in array specified by JSONPath in range betweenstart
(inclusive) andend
(exclusive) indexesarrayIndexMultiAsync
(String path, Object value) Returns index of object in arrays specified by JSONPatharrayIndexMultiAsync
(String path, Object value, long start, long end) Returns index of object in arrays specified by JSONPath in range betweenstart
(inclusive) andend
(exclusive) indexesarrayInsertAsync
(String path, long index, Object... values) Inserts values into array specified by JSONPath.arrayInsertMultiAsync
(String path, long index, Object... values) Inserts values into arrays specified by JSONPath.<T> RFuture<T>
arrayPollFirstAsync
(JsonCodec<T> codec, String path) Polls first element of array specified by JSONPath.arrayPollFirstMultiAsync
(JsonCodec<T> codec, String path) Polls first element of arrays specified by JSONPath.<T> RFuture<T>
arrayPollLastAsync
(JsonCodec<T> codec, String path) Polls last element of array specified by JSONPath.arrayPollLastMultiAsync
(JsonCodec<T> codec, String path) Polls last element of arrays specified by JSONPath.<T> RFuture<T>
arrayPopAsync
(JsonCodec<T> codec, String path, long index) Pops element located at index of array specified by JSONPath.arrayPopMultiAsync
(JsonCodec<T> codec, String path, long index) Pops elements located at index of arrays specified by JSONPath.arraySizeAsync
(String path) Returns size of array specified by JSONPath.arraySizeMultiAsync
(String path) Returns size of arrays specified by JSONPath.arrayTrimAsync
(String path, long start, long end) Trims array specified by JSONPath in range betweenstart
(inclusive) andend
(inclusive) indexes.arrayTrimMultiAsync
(String path, long start, long end) Trims arrays specified by JSONPath in range betweenstart
(inclusive) andend
(inclusive) indexes.Clears json container.clearAsync
(String path) Clears json container specified by JSONPath.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.Returns keys amount in JSON containercountKeysAsync
(String path) Returns keys amount in JSON container specified by JSONPathcountKeysMultiAsync
(String path) Returns list of keys amount in JSON containers specified by JSONPathdeleteAsync
(String path) Deletes JSON elements specified by JSONPath<T> RFuture<T>
getAndSetAsync
(JsonCodec<T> codec, String path, Object newValue) Retrieves current value of element specified by JSONPath and replaces it withnewValue
.<T> RFuture<T>
Get Json object/objects by JSONPathReturns list of keys in JSON containergetKeysAsync
(String path) Returns list of keys in JSON container specified by JSONPathgetKeysMultiAsync
(String path) Returns list of keys in JSON containers specified by JSONPathReturns type of elementgetTypeAsync
(String path) Returns type of element specified by JSONPathincrementAndGetAsync
(String path, T delta) Increments the current value specified by JSONPath bydelta
.incrementAndGetMultiAsync
(String path, T delta) Increments the current values specified by JSONPath bydelta
.Stores object into element by specified JSONPath.setIfAbsentAsync
(String path, Object value) Sets Json object by JSONPath only if previous value is emptysetIfExistsAsync
(String path, Object value) Sets Json object by JSONPath only if previous value is non-emptystringAppendAsync
(String path, Object value) Appends string data to element specified by JSONPath.stringAppendMultiAsync
(String path, Object value) Appends string data to elements specified by JSONPath.stringSizeAsync
(String path) Returns size of string data by JSONPathstringSizeMultiAsync
(String path) Returns list of string data size by JSONPath.toggleAsync
(String path) Toggle boolean value specified by JSONPathtoggleMultiAsync
(String path) Toggle boolean values specified by JSONPathtrySetAsync
(String path, Object value) Deprecated.Methods inherited from interface org.redisson.api.RBucketAsync
addListenerAsync, compareAndSetAsync, getAndClearExpireAsync, getAndDeleteAsync, getAndExpireAsync, getAndExpireAsync, getAndSetAsync, getAndSetAsync, getAsync, setAndKeepTTLAsync, setAsync, setAsync, setIfAbsentAsync, setIfAbsentAsync, setIfExistsAsync, setIfExistsAsync, sizeAsync, trySetAsync, trySetAsync
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
getAsync
Get Json object/objects by JSONPath- Type Parameters:
T
- the type of object- Parameters:
codec
- object codecpaths
- JSON paths- Returns:
- object
-
setIfAbsentAsync
Sets Json object by JSONPath only if previous value is empty- Parameters:
path
- JSON pathvalue
- object- Returns:
true
if successful, orfalse
if value was already set
-
trySetAsync
Deprecated.UsesetIfAbsentAsync(String, Object)
instead- Parameters:
path
- JSON pathvalue
- object- Returns:
true
if successful, orfalse
if value was already set
-
setIfExistsAsync
Sets Json object by JSONPath only if previous value is non-empty- Parameters:
path
- JSON pathvalue
- object- Returns:
true
if successful, orfalse
if element wasn't set
-
compareAndSetAsync
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 pathexpect
- the expected valueupdate
- the new value- Returns:
true
if successful; orfalse
if the actual value was not equal to the expected value.
-
getAndSetAsync
Retrieves current value of element specified by JSONPath and replaces it withnewValue
.- Parameters:
codec
- object codecpath
- JSON pathnewValue
- value to set- Returns:
- previous value
-
setAsync
Stores object into element by specified JSONPath.- Parameters:
path
- JSON pathvalue
- value to set- Returns:
- void
-
stringSizeAsync
Returns size of string data by JSONPath- Parameters:
path
- JSON path- Returns:
- size of string
-
stringSizeMultiAsync
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
Appends string data to element specified by JSONPath. Returns new size of string data.- Parameters:
path
- JSON pathvalue
- data- Returns:
- size of string data
-
stringAppendMultiAsync
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 pathvalue
- data- Returns:
- list of string data sizes
-
arrayAppendAsync
Appends values to array specified by JSONPath. Returns new size of array.- Parameters:
path
- JSON pathvalues
- values to append- Returns:
- size of array
-
arrayAppendMultiAsync
Appends values to arrays specified by JSONPath. Returns new size of arrays. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON pathvalues
- values to append- Returns:
- list of arrays size
-
arrayIndexAsync
Returns index of object in array specified by JSONPath. -1 means object not found.- Parameters:
path
- JSON pathvalue
- value to search- Returns:
- index in array
-
arrayIndexMultiAsync
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 pathvalue
- value to search- Returns:
- list of index in arrays
-
arrayIndexAsync
Returns index of object in array specified by JSONPath in range betweenstart
(inclusive) andend
(exclusive) indexes. -1 means object not found.- Parameters:
path
- JSON pathvalue
- value to searchstart
- start index, inclusiveend
- end index, exclusive- Returns:
- index in array
-
arrayIndexMultiAsync
Returns index of object in arrays specified by JSONPath in range betweenstart
(inclusive) andend
(exclusive) indexes. -1 means object not found. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON pathvalue
- value to searchstart
- start index, inclusiveend
- end index, exclusive- Returns:
- list of index in arrays
-
arrayInsertAsync
Inserts values into array specified by JSONPath. Values are inserted at definedindex
.- Parameters:
path
- JSON pathindex
- array index at which values are insertedvalues
- values to insert- Returns:
- size of array
-
arrayInsertMultiAsync
Inserts values into arrays specified by JSONPath. Values are inserted at definedindex
. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON pathindex
- array index at which values are insertedvalues
- values to insert- Returns:
- list of arrays size
-
arraySizeAsync
Returns size of array specified by JSONPath.- Parameters:
path
- JSON path- Returns:
- size of array
-
arraySizeMultiAsync
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
Polls last element of array specified by JSONPath.- Type Parameters:
T
- the type of object- Parameters:
codec
- object codecpath
- JSON path- Returns:
- last element
-
arrayPollLastMultiAsync
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 codecpath
- JSON path- Returns:
- list of last elements
-
arrayPollFirstAsync
Polls first element of array specified by JSONPath.- Type Parameters:
T
- the type of object- Parameters:
codec
- object codecpath
- JSON path- Returns:
- first element
-
arrayPollFirstMultiAsync
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 codecpath
- JSON path- Returns:
- list of first elements
-
arrayPopAsync
Pops element located at index of array specified by JSONPath.- Type Parameters:
T
- the type of object- Parameters:
codec
- object codecpath
- JSON pathindex
- array index- Returns:
- element
-
arrayPopMultiAsync
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 codecpath
- JSON pathindex
- array index- Returns:
- list of elements
-
arrayTrimAsync
Trims array specified by JSONPath in range betweenstart
(inclusive) andend
(inclusive) indexes.- Parameters:
path
- JSON pathstart
- start index, inclusiveend
- end index, inclusive- Returns:
- length of array
-
arrayTrimMultiAsync
Trims arrays specified by JSONPath in range betweenstart
(inclusive) andend
(inclusive) indexes. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON pathstart
- start index, inclusiveend
- end index, inclusive- Returns:
- length of array
-
clearAsync
Clears json container.- Returns:
- number of cleared containers
-
clearAsync
Clears json container specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON path- Returns:
- number of cleared containers
-
incrementAndGetAsync
Increments the current value specified by JSONPath bydelta
.- Parameters:
path
- JSON pathdelta
- increment value- Returns:
- the updated value
-
incrementAndGetMultiAsync
Increments the current values specified by JSONPath bydelta
. Compatible only with enhanced syntax starting with '$' character.- Parameters:
path
- JSON pathdelta
- increment value- Returns:
- list of updated value
-
countKeysAsync
Returns keys amount in JSON container- Returns:
- keys amount
-
countKeysAsync
Returns keys amount in JSON container specified by JSONPath- Parameters:
path
- JSON path- Returns:
- keys amount
-
countKeysMultiAsync
Returns list of keys amount in JSON containers specified by JSONPath- Parameters:
path
- JSON path- Returns:
- list of keys amount
-
getKeysAsync
Returns list of keys in JSON container- Returns:
- list of keys
-
getKeysAsync
Returns list of keys in JSON container specified by JSONPath- Parameters:
path
- JSON path- Returns:
- list of keys
-
getKeysMultiAsync
Returns list of keys in JSON containers specified by JSONPath- Parameters:
path
- JSON path- Returns:
- list of keys
-
toggleAsync
Toggle boolean value specified by JSONPath- Parameters:
path
- JSON path- Returns:
- new boolean value
-
toggleMultiAsync
Toggle boolean values specified by JSONPath- Parameters:
path
- JSON path- Returns:
- list of boolean values
-
getTypeAsync
Returns type of element- Returns:
- type of element
-
getTypeAsync
Returns type of element specified by JSONPath- Parameters:
path
- JSON path- Returns:
- type of element
-
deleteAsync
Deletes JSON elements specified by JSONPath- Parameters:
path
- JSON path- Returns:
- number of deleted elements
-