Class ReactiveStringCommandsImpl<K,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommands
-
- io.quarkus.redis.runtime.datasource.AbstractStringCommands<K,V>
-
- io.quarkus.redis.runtime.datasource.ReactiveStringCommandsImpl<K,V>
-
- All Implemented Interfaces:
ReactiveRedisCommands
,ReactiveStringCommands<K,V>
,ReactiveValueCommands<K,V>
public class ReactiveStringCommandsImpl<K,V> extends AbstractStringCommands<K,V> implements ReactiveStringCommands<K,V>, ReactiveValueCommands<K,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractStringCommands
LCS, typeOfValue
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
marshaller, redis
-
-
Constructor Summary
Constructors Constructor Description ReactiveStringCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k, Class<V> v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Long>
append(K key, V value)
Execute the command APPEND.io.smallrye.mutiny.Uni<Long>
decr(K key)
Execute the command DECR.io.smallrye.mutiny.Uni<Long>
decrby(K key, long amount)
Execute the command DECRBY.io.smallrye.mutiny.Uni<V>
get(K key)
Execute the command GET.ReactiveRedisDataSource
getDataSource()
io.smallrye.mutiny.Uni<V>
getdel(K key)
Execute the command GETDEL.io.smallrye.mutiny.Uni<V>
getex(K key, GetExArgs args)
Execute the command GETEX.io.smallrye.mutiny.Uni<V>
getex(K key, GetExArgs args)
Execute the command GETEX.io.smallrye.mutiny.Uni<String>
getrange(K key, long start, long end)
Execute the command GETRANGE.io.smallrye.mutiny.Uni<V>
getset(K key, V value)
Execute the command GETSET.io.smallrye.mutiny.Uni<Long>
incr(K key)
Execute the command INCR.io.smallrye.mutiny.Uni<Long>
incrby(K key, long amount)
Execute the command INCRBY.io.smallrye.mutiny.Uni<Double>
incrbyfloat(K key, double amount)
Execute the command INCRBYFLOAT.io.smallrye.mutiny.Uni<String>
lcs(K key1, K key2)
Execute the command LCS.io.smallrye.mutiny.Uni<Long>
lcsLength(K key1, K key2)
Execute the command LCS.io.smallrye.mutiny.Uni<Map<K,V>>
mget(K... keys)
Execute the command MGET.io.smallrye.mutiny.Uni<Void>
mset(Map<K,V> map)
Execute the command MSET.io.smallrye.mutiny.Uni<Boolean>
msetnx(Map<K,V> map)
Execute the command MSETNX.io.smallrye.mutiny.Uni<Void>
psetex(K key, long milliseconds, V value)
Execute the command PSETEX.io.smallrye.mutiny.Uni<Void>
set(K key, V value)
Execute the command SET.io.smallrye.mutiny.Uni<Void>
set(K key, V value, SetArgs setArgs)
Execute the command SET.io.smallrye.mutiny.Uni<Void>
set(K key, V value, SetArgs setArgs)
Execute the command SET.io.smallrye.mutiny.Uni<Void>
setex(K key, long seconds, V value)
Execute the command SETEX.io.smallrye.mutiny.Uni<V>
setGet(K key, V value)
Execute the command SET.io.smallrye.mutiny.Uni<V>
setGet(K key, V value, SetArgs setArgs)
Execute the command SET.io.smallrye.mutiny.Uni<V>
setGet(K key, V value, SetArgs setArgs)
Execute the command SET.io.smallrye.mutiny.Uni<Boolean>
setnx(K key, V value)
Execute the command SETNX.io.smallrye.mutiny.Uni<Long>
setrange(K key, long offset, V value)
Execute the command SETRANGE.io.smallrye.mutiny.Uni<Long>
strlen(K key)
Execute the command STRLEN.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractStringCommands
_append, _decr, _decrby, _get, _getdel, _getex, _getex, _getrange, _getset, _incr, _incrby, _incrbyfloat, _lcs, _lcsLength, _mget, _mset, _msetnx, _psetex, _set, _set, _set, _setex, _setGet, _setGet, _setGet, _setnx, _setrange, _strlen, decodeAsOrderedMap, decodeV
-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
execute
-
-
-
-
Constructor Detail
-
ReactiveStringCommandsImpl
public ReactiveStringCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k, Class<V> v)
-
-
Method Detail
-
getDataSource
public ReactiveRedisDataSource getDataSource()
- Specified by:
getDataSource
in interfaceReactiveRedisCommands
- Returns:
- the data source.
-
set
public io.smallrye.mutiny.Uni<Void> set(K key, V value)
Description copied from interface:ReactiveStringCommands
Execute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
set
in interfaceReactiveStringCommands<K,V>
- Specified by:
set
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
- a Uni producing a
null
item on success, a failure otherwise
-
set
public io.smallrye.mutiny.Uni<Void> set(K key, V value, SetArgs setArgs)
Description copied from interface:ReactiveStringCommands
Execute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
set
in interfaceReactiveStringCommands<K,V>
- Parameters:
key
- the keyvalue
- the valuesetArgs
- the set command extra-arguments- Returns:
- a Uni producing a
null
item on success, a failure otherwise
-
set
public io.smallrye.mutiny.Uni<Void> set(K key, V value, SetArgs setArgs)
Description copied from interface:ReactiveValueCommands
Execute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
set
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the valuesetArgs
- the set command extra-arguments- Returns:
- a Uni producing a
null
item on success, a failure otherwise
-
setGet
public io.smallrye.mutiny.Uni<V> setGet(K key, V value)
Description copied from interface:ReactiveStringCommands
Execute the command SET. Summary: Set the string value of a key, and return the previous value Group: string Requires Redis 1.0.0- Specified by:
setGet
in interfaceReactiveStringCommands<K,V>
- Specified by:
setGet
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the old value,
null
if not present
-
setGet
public io.smallrye.mutiny.Uni<V> setGet(K key, V value, SetArgs setArgs)
Description copied from interface:ReactiveStringCommands
Execute the command SET. Summary: Set the string value of a key, and return the previous value Group: string Requires Redis 1.0.0- Specified by:
setGet
in interfaceReactiveStringCommands<K,V>
- Parameters:
key
- the keyvalue
- the valuesetArgs
- the set command extra-arguments- Returns:
- the old value,
null
if not present
-
setGet
public io.smallrye.mutiny.Uni<V> setGet(K key, V value, SetArgs setArgs)
Description copied from interface:ReactiveValueCommands
Execute the command SET. Summary: Set the string value of a key, and return the previous value Group: string Requires Redis 1.0.0- Specified by:
setGet
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the valuesetArgs
- the set command extra-arguments- Returns:
- the old value,
null
if not present
-
setex
public io.smallrye.mutiny.Uni<Void> setex(K key, long seconds, V value)
Description copied from interface:ReactiveStringCommands
Execute the command SETEX. Summary: Set the value and expiration of a key Group: string Requires Redis 2.0.0- Specified by:
setex
in interfaceReactiveStringCommands<K,V>
- Specified by:
setex
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value
-
psetex
public io.smallrye.mutiny.Uni<Void> psetex(K key, long milliseconds, V value)
Description copied from interface:ReactiveStringCommands
Execute the command PSETEX. Summary: Set the value and expiration in milliseconds of a key Group: string Requires Redis 2.6.0- Specified by:
psetex
in interfaceReactiveStringCommands<K,V>
- Specified by:
psetex
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keymilliseconds
- the duration in msvalue
- the value- Returns:
- a Uni producing a
null
item on success, a failure otherwise
-
setnx
public io.smallrye.mutiny.Uni<Boolean> setnx(K key, V value)
Description copied from interface:ReactiveStringCommands
Execute the command SETNX. Summary: Set the value of a key, only if the key does not exist Group: string Requires Redis 1.0.0- Specified by:
setnx
in interfaceReactiveStringCommands<K,V>
- Specified by:
setnx
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
true
the key was setfalse
the key was not set
-
setrange
public io.smallrye.mutiny.Uni<Long> setrange(K key, long offset, V value)
Description copied from interface:ReactiveStringCommands
Execute the command SETRANGE. Summary: Overwrite part of a string at key starting at the specified offset Group: string Requires Redis 2.2.0- Specified by:
setrange
in interfaceReactiveStringCommands<K,V>
- Specified by:
setrange
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the length of the string after it was modified by the command.
-
strlen
public io.smallrye.mutiny.Uni<Long> strlen(K key)
Description copied from interface:ReactiveStringCommands
Execute the command STRLEN. Summary: Get the length of the value stored in a key Group: string Requires Redis 2.2.0- Specified by:
strlen
in interfaceReactiveStringCommands<K,V>
- Specified by:
strlen
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the key- Returns:
- the length of the string at key, or 0 when key does not exist.
-
decr
public io.smallrye.mutiny.Uni<Long> decr(K key)
Description copied from interface:ReactiveStringCommands
Execute the command DECR. Summary: Decrement the integer value of a key by one Group: string Requires Redis 1.0.0- Specified by:
decr
in interfaceReactiveStringCommands<K,V>
- Specified by:
decr
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the key- Returns:
- the value of key after the decrement
-
decrby
public io.smallrye.mutiny.Uni<Long> decrby(K key, long amount)
Description copied from interface:ReactiveStringCommands
Execute the command DECRBY. Summary: Decrement the integer value of a key by the given number Group: string Requires Redis 1.0.0- Specified by:
decrby
in interfaceReactiveStringCommands<K,V>
- Specified by:
decrby
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyamount
- the amount, can be negative- Returns:
- the value of key after the decrement
-
get
public io.smallrye.mutiny.Uni<V> get(K key)
Description copied from interface:ReactiveStringCommands
Execute the command GET. Summary: Get the value of a key Group: string Requires Redis 1.0.0- Specified by:
get
in interfaceReactiveStringCommands<K,V>
- Specified by:
get
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the key- Returns:
- the value of key, or
null
when key does not exist.
-
getdel
public io.smallrye.mutiny.Uni<V> getdel(K key)
Description copied from interface:ReactiveStringCommands
Execute the command GETDEL. Summary: Get the value of a key and delete the key Group: string Requires Redis 6.2.0- Specified by:
getdel
in interfaceReactiveStringCommands<K,V>
- Specified by:
getdel
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the key- Returns:
- the value of key,
null
when key does not exist, or an error if the key's value type isn't a string.
-
getex
public io.smallrye.mutiny.Uni<V> getex(K key, GetExArgs args)
Description copied from interface:ReactiveStringCommands
Execute the command GETEX. Summary: Get the value of a key and optionally set its expiration Group: string Requires Redis 6.2.0- Specified by:
getex
in interfaceReactiveStringCommands<K,V>
- Parameters:
key
- the keyargs
- the getex command extra-arguments- Returns:
- the value of key, or
null
when key does not exist.
-
getex
public io.smallrye.mutiny.Uni<V> getex(K key, GetExArgs args)
Description copied from interface:ReactiveValueCommands
Execute the command GETEX. Summary: Get the value of a key and optionally set its expiration Group: string Requires Redis 6.2.0- Specified by:
getex
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyargs
- the getex command extra-arguments- Returns:
- the value of key, or
null
when key does not exist.
-
getrange
public io.smallrye.mutiny.Uni<String> getrange(K key, long start, long end)
Description copied from interface:ReactiveStringCommands
Execute the command GETRANGE. Summary: Get a substring of the string stored at a key Group: string Requires Redis 2.4.0- Specified by:
getrange
in interfaceReactiveStringCommands<K,V>
- Specified by:
getrange
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keystart
- the start offsetend
- the end offset- Returns:
- the sub-string
-
getset
public io.smallrye.mutiny.Uni<V> getset(K key, V value)
Description copied from interface:ReactiveStringCommands
Execute the command GETSET. Summary: Set the string value of a key and return its old value Group: string Requires Redis 1.0.0- Specified by:
getset
in interfaceReactiveStringCommands<K,V>
- Specified by:
getset
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the old value stored at key, or
null
when key did not exist.
-
incr
public io.smallrye.mutiny.Uni<Long> incr(K key)
Description copied from interface:ReactiveStringCommands
Execute the command INCR. Summary: Increment the integer value of a key by one Group: string Requires Redis 1.0.0- Specified by:
incr
in interfaceReactiveStringCommands<K,V>
- Specified by:
incr
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the key- Returns:
- the value of key after the increment
-
incrby
public io.smallrye.mutiny.Uni<Long> incrby(K key, long amount)
Description copied from interface:ReactiveStringCommands
Execute the command INCRBY. Summary: Increment the integer value of a key by the given amount Group: string Requires Redis 1.0.0- Specified by:
incrby
in interfaceReactiveStringCommands<K,V>
- Specified by:
incrby
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyamount
- the amount, can be negative- Returns:
- the value of key after the increment
-
incrbyfloat
public io.smallrye.mutiny.Uni<Double> incrbyfloat(K key, double amount)
Description copied from interface:ReactiveStringCommands
Execute the command INCRBYFLOAT. Summary: Increment the float value of a key by the given amount Group: string Requires Redis 2.6.0- Specified by:
incrbyfloat
in interfaceReactiveStringCommands<K,V>
- Specified by:
incrbyfloat
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyamount
- the amount, can be negative- Returns:
- the value of key after the increment.
-
append
public io.smallrye.mutiny.Uni<Long> append(K key, V value)
Description copied from interface:ReactiveStringCommands
Execute the command APPEND. Summary: Append a value to a key Group: string Requires Redis 2.0.0- Specified by:
append
in interfaceReactiveStringCommands<K,V>
- Specified by:
append
in interfaceReactiveValueCommands<K,V>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the length of the string after the append operation.
-
mget
public io.smallrye.mutiny.Uni<Map<K,V>> mget(K... keys)
Description copied from interface:ReactiveStringCommands
Execute the command MGET. Summary: Get the values of all the given keys Group: string Requires Redis 1.0.0- Specified by:
mget
in interfaceReactiveStringCommands<K,V>
- Specified by:
mget
in interfaceReactiveValueCommands<K,V>
- Parameters:
keys
- the keys- Returns:
- the value of key, or
null
when key does not exist. If one of the passed key does not exist, the returned map contains anull
value associated with the missing key.
-
mset
public io.smallrye.mutiny.Uni<Void> mset(Map<K,V> map)
Description copied from interface:ReactiveStringCommands
Execute the command MSET. Summary: Set multiple keys to multiple values Group: string Requires Redis 1.0.1- Specified by:
mset
in interfaceReactiveStringCommands<K,V>
- Specified by:
mset
in interfaceReactiveValueCommands<K,V>
- Parameters:
map
- the key/value map containing the items to store- Returns:
- a Uni producing a
null
item on success, a failure otherwise
-
msetnx
public io.smallrye.mutiny.Uni<Boolean> msetnx(Map<K,V> map)
Description copied from interface:ReactiveStringCommands
Execute the command MSETNX. Summary: Set multiple keys to multiple values, only if none of the keys exist Group: string Requires Redis 1.0.1- Specified by:
msetnx
in interfaceReactiveStringCommands<K,V>
- Specified by:
msetnx
in interfaceReactiveValueCommands<K,V>
- Parameters:
map
- the key/value map containing the items to store- Returns:
true
the all the keys were set.false
no key was set (at least one key already existed).
-
lcs
public io.smallrye.mutiny.Uni<String> lcs(K key1, K key2)
Description copied from interface:ReactiveStringCommands
Execute the command LCS. Summary: Find longest common substring Group: string Requires Redis 7.0.0- Specified by:
lcs
in interfaceReactiveStringCommands<K,V>
- Specified by:
lcs
in interfaceReactiveValueCommands<K,V>
- Parameters:
key1
- the keykey2
- the key- Returns:
- the string representing the longest common substring is returned.
-
lcsLength
public io.smallrye.mutiny.Uni<Long> lcsLength(K key1, K key2)
Description copied from interface:ReactiveStringCommands
Execute the command LCS. Summary: Find longest common substring and return the length (usingLEN
) Group: string Requires Redis 7.0.0- Specified by:
lcsLength
in interfaceReactiveStringCommands<K,V>
- Specified by:
lcsLength
in interfaceReactiveValueCommands<K,V>
- Parameters:
key1
- the keykey2
- the key- Returns:
- the length of the longest common substring.
-
-