Interface BoundValueOperations<K,V>
- All Superinterfaces:
BoundKeyOperations<K>
Value (or String in Redis terminology) operations bound to a certain key.
- Author:
- Costin Leau, Mark Paluch, Jiahe Cai, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionAppend avalue
to the bound key.Decrement an integer value stored as string value under the bound key by one.decrement
(long delta) Decrement an integer value stored as string value under the bound key bydelta
.get()
Get the value of the bound key.get
(long start, long end) Get a substring of value of the bound key betweenbegin
andend
.Return the value at the bound key and delete the key.getAndExpire
(long timeout, TimeUnit unit) Return the value at the bound key and expire the key by applyingtimeout
.getAndExpire
(Duration timeout) Return the value at the bound key and expire the key by applyingtimeout
.Return the value at the bound key and persist the key.Setvalue
of the bound key and return its old value.Increment an integer value stored as string value under the bound key by one.increment
(double delta) Increment a floating point number value stored as string value under the bound key bydelta
.increment
(long delta) Increment an integer value stored as string value under the bound key bydelta
.void
Setvalue
for the bound key.void
Overwrite parts of the bound key starting at the specifiedoffset
with givenvalue
.void
Set thevalue
and expirationtimeout
for the bound key.default void
Set thevalue
and expirationtimeout
for the bound key.setIfAbsent
(V value) Set the bound key to hold the stringvalue
if the bound key is absent.setIfAbsent
(V value, long timeout, TimeUnit unit) Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is absent.default Boolean
setIfAbsent
(V value, Duration timeout) Set bound key to hold the stringvalue
and expirationtimeout
if the bound key is absent.setIfPresent
(V value) Set the bound key to hold the stringvalue
if the bound key is present.setIfPresent
(V value, long timeout, TimeUnit unit) Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is present.default Boolean
setIfPresent
(V value, Duration timeout) Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is present.size()
Get the length of the value stored at the bound key.
-
Method Details
-
set
Setvalue
for the bound key.- Parameters:
value
- must not be null.- See Also:
-
set
Set thevalue
and expirationtimeout
for the bound key.- Parameters:
value
- must not be null.timeout
-unit
- must not be null.- See Also:
-
set
Set thevalue
and expirationtimeout
for the bound key.- Parameters:
value
- must not be null.timeout
- must not be null.- Throws:
IllegalArgumentException
- if eithervalue
ortimeout
is not present.- Since:
- 2.1
- See Also:
-
setIfAbsent
Set the bound key to hold the stringvalue
if the bound key is absent.- Parameters:
value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
setIfAbsent
Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is absent.- Parameters:
value
- must not be null.timeout
-unit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
setIfAbsent
Set bound key to hold the stringvalue
and expirationtimeout
if the bound key is absent.- Parameters:
value
- must not be null.timeout
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Throws:
IllegalArgumentException
- if eithervalue
ortimeout
is not present.- Since:
- 2.1
- See Also:
-
setIfPresent
Set the bound key to hold the stringvalue
if the bound key is present.- Parameters:
value
- must not be null.- Returns:
- command result indicating if the key has been set.
- Throws:
IllegalArgumentException
- ifvalue
is not present.- Since:
- 2.1
- See Also:
-
setIfPresent
Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is present.- Parameters:
value
- must not be null.timeout
- the key expiration timeout.unit
- must not be null.- Returns:
- command result indicating if the key has been set.
- Throws:
IllegalArgumentException
- if eithervalue
ortimeout
is not present.- Since:
- 2.1
- See Also:
-
setIfPresent
Set the bound key to hold the stringvalue
and expirationtimeout
if the bound key is present.- Parameters:
value
- must not be null.timeout
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Throws:
IllegalArgumentException
- if eithervalue
ortimeout
is not present.- Since:
- 2.1
- See Also:
-
get
Get the value of the bound key.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getAndDelete
Return the value at the bound key and delete the key.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getAndExpire
Return the value at the bound key and expire the key by applyingtimeout
.- Parameters:
timeout
-unit
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getAndExpire
Return the value at the bound key and expire the key by applyingtimeout
.- Parameters:
timeout
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getAndPersist
Return the value at the bound key and persist the key. This operation removes any TTL that is associated with the bound key.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getAndSet
Setvalue
of the bound key and return its old value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
increment
Increment an integer value stored as string value under the bound key by one.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
increment
Increment an integer value stored as string value under the bound key bydelta
.- Parameters:
delta
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
increment
Increment a floating point number value stored as string value under the bound key bydelta
.- Parameters:
delta
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
decrement
Decrement an integer value stored as string value under the bound key by one.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
decrement
Decrement an integer value stored as string value under the bound key bydelta
.- Parameters:
delta
-- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
append
Append avalue
to the bound key.- Parameters:
value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
get
Get a substring of value of the bound key betweenbegin
andend
.- Parameters:
start
-end
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
set
Overwrite parts of the bound key starting at the specifiedoffset
with givenvalue
.- Parameters:
value
- must not be null.offset
-- See Also:
-
size
Get the length of the value stored at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
getOperations
RedisOperations<K,V> getOperations()- Returns:
- never null.
-