Class BlockingStringCommandsImpl<K,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
-
- io.quarkus.redis.runtime.datasource.BlockingStringCommandsImpl<K,V>
-
- All Implemented Interfaces:
RedisCommands,StringCommands<K,V>,ValueCommands<K,V>
public class BlockingStringCommandsImpl<K,V> extends AbstractRedisCommandGroup implements StringCommands<K,V>, ValueCommands<K,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
-
Constructor Summary
Constructors Constructor Description BlockingStringCommandsImpl(RedisDataSource ds, ReactiveValueCommands<K,V> reactive, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longappend(K key, V value)Execute the command APPEND.longdecr(K key)Execute the command DECR.longdecrby(K key, long amount)Execute the command DECRBY.Vget(K key)Execute the command GET.Vgetdel(K key)Execute the command GETDEL.Vgetex(K key, GetExArgs args)Execute the command GETEX.Vgetex(K key, GetExArgs args)Execute the command GETEX.Stringgetrange(K key, long start, long end)Execute the command GETRANGE.Vgetset(K key, V value)Execute the command GETSET.longincr(K key)Execute the command INCR.longincrby(K key, long amount)Execute the command INCRBY.doubleincrbyfloat(K key, double amount)Execute the command INCRBYFLOAT.Stringlcs(K key1, K key2)Execute the command LCS.longlcsLength(K key1, K key2)Execute the command LCS.Map<K,V>mget(K... keys)Execute the command MGET.voidmset(Map<K,V> map)Execute the command MSET.booleanmsetnx(Map<K,V> map)Execute the command MSETNX.voidpsetex(K key, long milliseconds, V value)Execute the command PSETEX.voidset(K key, V value)Execute the command SET.voidset(K key, V value, SetArgs setArgs)Execute the command SET.voidset(K key, V value, SetArgs setArgs)Execute the command SET.voidsetex(K key, long seconds, V value)Execute the command SETEX.VsetGet(K key, V value)Execute the command SET.VsetGet(K key, V value, SetArgs setArgs)Execute the command SET.VsetGet(K key, V value, SetArgs setArgs)Execute the command SET.booleansetnx(K key, V value)Execute the command SETNX.longsetrange(K key, long offset, V value)Execute the command SETRANGE.longstrlen(K key)Execute the command STRLEN.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
getDataSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommands
getDataSource
-
-
-
-
Constructor Detail
-
BlockingStringCommandsImpl
public BlockingStringCommandsImpl(RedisDataSource ds, ReactiveValueCommands<K,V> reactive, Duration timeout)
-
-
Method Detail
-
append
public long append(K key, V value)
Description copied from interface:StringCommandsExecute the command APPEND. Summary: Append a value to a key Group: string Requires Redis 2.0.0- Specified by:
appendin interfaceStringCommands<K,V>- Specified by:
appendin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value- Returns:
- the length of the string after the append operation.
-
decr
public long decr(K key)
Description copied from interface:StringCommandsExecute the command DECR. Summary: Decrement the integer value of a key by one Group: string Requires Redis 1.0.0- Specified by:
decrin interfaceStringCommands<K,V>- Specified by:
decrin interfaceValueCommands<K,V>- Parameters:
key- the key- Returns:
- the value of key after the decrement
-
decrby
public long decrby(K key, long amount)
Description copied from interface:StringCommandsExecute the command DECRBY. Summary: Decrement the integer value of a key by the given number Group: string Requires Redis 1.0.0- Specified by:
decrbyin interfaceStringCommands<K,V>- Specified by:
decrbyin interfaceValueCommands<K,V>- Parameters:
key- the keyamount- the amount, can be negative- Returns:
- the value of key after the decrement
-
get
public V get(K key)
Description copied from interface:StringCommandsExecute the command GET. Summary: Get the value of a key Group: string Requires Redis 1.0.0- Specified by:
getin interfaceStringCommands<K,V>- Specified by:
getin interfaceValueCommands<K,V>- Parameters:
key- the key- Returns:
- the value of key, or
nullwhen key does not exist.
-
getdel
public V getdel(K key)
Description copied from interface:StringCommandsExecute the command GETDEL. Summary: Get the value of a key and delete the key Group: string Requires Redis 6.2.0- Specified by:
getdelin interfaceStringCommands<K,V>- Specified by:
getdelin interfaceValueCommands<K,V>- Parameters:
key- the key- Returns:
- the value of key,
nullwhen key does not exist, or an error if the key's value type isn't a string.
-
getex
public V getex(K key, GetExArgs args)
Description copied from interface:StringCommandsExecute the command GETEX. Summary: Get the value of a key and optionally set its expiration Group: string Requires Redis 6.2.0- Specified by:
getexin interfaceStringCommands<K,V>- Parameters:
key- the keyargs- the getex command extra-arguments- Returns:
- the value of key, or
nullwhen key does not exist.
-
getex
public V getex(K key, GetExArgs args)
Description copied from interface:ValueCommandsExecute the command GETEX. Summary: Get the value of a key and optionally set its expiration Group: string Requires Redis 6.2.0- Specified by:
getexin interfaceValueCommands<K,V>- Parameters:
key- the keyargs- the getex command extra-arguments- Returns:
- the value of key, or
nullwhen key does not exist.
-
getrange
public String getrange(K key, long start, long end)
Description copied from interface:StringCommandsExecute the command GETRANGE. Summary: Get a substring of the string stored at a key Group: string Requires Redis 2.4.0- Specified by:
getrangein interfaceStringCommands<K,V>- Specified by:
getrangein interfaceValueCommands<K,V>- Parameters:
key- the keystart- the start offsetend- the end offset- Returns:
- the sub-string
-
getset
public V getset(K key, V value)
Description copied from interface:StringCommandsExecute 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:
getsetin interfaceStringCommands<K,V>- Specified by:
getsetin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value- Returns:
- the old value stored at key, or
nullwhen key did not exist.
-
incr
public long incr(K key)
Description copied from interface:StringCommandsExecute the command INCR. Summary: Increment the integer value of a key by one Group: string Requires Redis 1.0.0- Specified by:
incrin interfaceStringCommands<K,V>- Specified by:
incrin interfaceValueCommands<K,V>- Parameters:
key- the key- Returns:
- the value of key after the increment
-
incrby
public long incrby(K key, long amount)
Description copied from interface:StringCommandsExecute the command INCRBY. Summary: Increment the integer value of a key by the given amount Group: string Requires Redis 1.0.0- Specified by:
incrbyin interfaceStringCommands<K,V>- Specified by:
incrbyin interfaceValueCommands<K,V>- Parameters:
key- the keyamount- the amount, can be negative- Returns:
- the value of key after the increment
-
incrbyfloat
public double incrbyfloat(K key, double amount)
Description copied from interface:StringCommandsExecute the command INCRBYFLOAT. Summary: Increment the float value of a key by the given amount Group: string Requires Redis 2.6.0- Specified by:
incrbyfloatin interfaceStringCommands<K,V>- Specified by:
incrbyfloatin interfaceValueCommands<K,V>- Parameters:
key- the keyamount- the amount, can be negative- Returns:
- the value of key after the increment.
-
lcs
public String lcs(K key1, K key2)
Description copied from interface:StringCommandsExecute the command LCS. Summary: Find longest common substring Group: string Requires Redis 7.0.0- Specified by:
lcsin interfaceStringCommands<K,V>- Specified by:
lcsin interfaceValueCommands<K,V>- Parameters:
key1- the keykey2- the key- Returns:
- the string representing the longest common substring is returned.
-
lcsLength
public long lcsLength(K key1, K key2)
Description copied from interface:StringCommandsExecute the command LCS. Summary: Find longest common substring and return the length (usingLEN) Group: string Requires Redis 7.0.0- Specified by:
lcsLengthin interfaceStringCommands<K,V>- Specified by:
lcsLengthin interfaceValueCommands<K,V>- Parameters:
key1- the keykey2- the key- Returns:
- the length of the longest common substring.
-
mget
public Map<K,V> mget(K... keys)
Description copied from interface:StringCommandsExecute the command MGET. Summary: Get the values of all the given keys Group: string Requires Redis 1.0.0- Specified by:
mgetin interfaceStringCommands<K,V>- Specified by:
mgetin interfaceValueCommands<K,V>- Parameters:
keys- the keys- Returns:
- list of values at the specified keys. If one of the passed key does not exist, the returned map contains
a
nullvalue associated with the missing key.
-
mset
public void mset(Map<K,V> map)
Description copied from interface:StringCommandsExecute the command MSET. Summary: Set multiple keys to multiple values Group: string Requires Redis 1.0.1- Specified by:
msetin interfaceStringCommands<K,V>- Specified by:
msetin interfaceValueCommands<K,V>- Parameters:
map- the key/value map containing the items to store
-
msetnx
public boolean msetnx(Map<K,V> map)
Description copied from interface:StringCommandsExecute 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:
msetnxin interfaceStringCommands<K,V>- Specified by:
msetnxin interfaceValueCommands<K,V>- Parameters:
map- the key/value map containing the items to store- Returns:
truethe all the keys were set.falseno key was set (at least one key already existed).
-
set
public void set(K key, V value)
Description copied from interface:StringCommandsExecute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
setin interfaceStringCommands<K,V>- Specified by:
setin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value
-
set
public void set(K key, V value, SetArgs setArgs)
Description copied from interface:StringCommandsExecute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
setin interfaceStringCommands<K,V>- Parameters:
key- the keyvalue- the valuesetArgs- the set command extra-arguments
-
set
public void set(K key, V value, SetArgs setArgs)
Description copied from interface:ValueCommandsExecute the command SET. Summary: Set the string value of a key Group: string Requires Redis 1.0.0- Specified by:
setin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the valuesetArgs- the set command extra-arguments
-
setGet
public V setGet(K key, V value)
Description copied from interface:StringCommandsExecute 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:
setGetin interfaceStringCommands<K,V>- Specified by:
setGetin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value- Returns:
- the old value,
nullif not present
-
setGet
public V setGet(K key, V value, SetArgs setArgs)
Description copied from interface:StringCommandsExecute 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:
setGetin interfaceStringCommands<K,V>- Parameters:
key- the keyvalue- the valuesetArgs- the set command extra-arguments- Returns:
- the old value,
nullif not present
-
setGet
public V setGet(K key, V value, SetArgs setArgs)
Description copied from interface:ValueCommandsExecute 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:
setGetin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the valuesetArgs- the set command extra-arguments- Returns:
- the old value,
nullif not present
-
setex
public void setex(K key, long seconds, V value)
Description copied from interface:StringCommandsExecute the command SETEX. Summary: Set the value and expiration of a key Group: string Requires Redis 2.0.0- Specified by:
setexin interfaceStringCommands<K,V>- Specified by:
setexin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value
-
psetex
public void psetex(K key, long milliseconds, V value)
Description copied from interface:StringCommandsExecute the command PSETEX. Summary: Set the value and expiration in milliseconds of a key Group: string Requires Redis 2.6.0- Specified by:
psetexin interfaceStringCommands<K,V>- Specified by:
psetexin interfaceValueCommands<K,V>- Parameters:
key- the keymilliseconds- the duration in msvalue- the value
-
setnx
public boolean setnx(K key, V value)
Description copied from interface:StringCommandsExecute 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:
setnxin interfaceStringCommands<K,V>- Specified by:
setnxin interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value- Returns:
truethe key was setfalsethe key was not set
-
setrange
public long setrange(K key, long offset, V value)
Description copied from interface:StringCommandsExecute 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:
setrangein interfaceStringCommands<K,V>- Specified by:
setrangein interfaceValueCommands<K,V>- Parameters:
key- the keyvalue- the value- Returns:
- the length of the string after it was modified by the command.
-
strlen
public long strlen(K key)
Description copied from interface:StringCommandsExecute the command STRLEN. Summary: Get the length of the value stored in a key Group: string Requires Redis 2.2.0- Specified by:
strlenin interfaceStringCommands<K,V>- Specified by:
strlenin interfaceValueCommands<K,V>- Parameters:
key- the key- Returns:
- the length of the string at key, or 0 when key does not exist.
-
-