java.lang.Object
io.lettuce.core.SetArgs
- All Implemented Interfaces:
CompositeArgument
public class SetArgs extends Object implements CompositeArgument
Argument list builder for the Redis SET command starting from Redis 2.6.12. Static
import the methods from
SetArgs.Builder and chain the method calls: ex(10).nx().
SetArgs is a mutable object and instances should be used only once to avoid shared mutable state.
- Author:
- Will Glozer, Vincent Rischmann, Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSetArgs.BuilderBuilder entry points forSetArgs. -
Constructor Summary
Constructors Constructor Description SetArgs() -
Method Summary
Modifier and Type Method Description <K, V> voidbuild(CommandArgs<K,V> args)Build command arguments and contribute arguments toCommandArgs.SetArgsex(long timeout)Set the specified expire time, in seconds.SetArgsex(Duration timeout)Set the specified expire time, in seconds.SetArgsexAt(long timestamp)Set the specified expire at time using a posixtimestamp.SetArgsexAt(Instant timestamp)Set the specified expire at time using a posixtimestamp.SetArgsexAt(Date timestamp)Set the specified expire at time using a posixtimestamp.SetArgskeepttl()Set the value and retain the existing TTL.SetArgsnx()Only set the key if it does not already exist.SetArgspx(long timeout)Set the specified expire time, in milliseconds.SetArgspx(Duration timeout)Set the specified expire time, in milliseconds.SetArgspxAt(long timestamp)Set the specified expire at time using a posixtimestamp.SetArgspxAt(Instant timestamp)Set the specified expire at time using a posixtimestamp.SetArgspxAt(Date timestamp)Set the specified expire at time using a posixtimestamp.SetArgsxx()Only set the key if it already exists.
-
Constructor Details
-
SetArgs
public SetArgs()
-
-
Method Details
-
ex
Set the specified expire time, in seconds.- Parameters:
timeout- expire time in seconds.- Returns:
thisSetArgs.
-
ex
Set the specified expire time, in seconds.- Parameters:
timeout- expire time in seconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
exAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in seconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
exAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in seconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
exAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in seconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
px
Set the specified expire time, in milliseconds.- Parameters:
timeout- expire time in milliseconds.- Returns:
thisSetArgs.
-
px
Set the specified expire time, in milliseconds.- Parameters:
timeout- expire time in milliseconds.- Returns:
thisSetArgs.
-
pxAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in milliseconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
pxAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in milliseconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
pxAt
Set the specified expire at time using a posixtimestamp.- Parameters:
timestamp- the timestamp type: posix time in milliseconds.- Returns:
thisSetArgs.- Since:
- 6.1
-
nx
Only set the key if it does not already exist.- Returns:
thisSetArgs.
-
keepttl
Set the value and retain the existing TTL.- Returns:
thisSetArgs.- Since:
- 5.3
-
xx
Only set the key if it already exists.- Returns:
thisSetArgs.
-
build
Description copied from interface:CompositeArgumentBuild command arguments and contribute arguments toCommandArgs.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
buildin interfaceCompositeArgument- Type Parameters:
K- Key type.V- Value type.- Parameters:
args- the command arguments, must not benull.
-