Package io.lettuce.core
Class ExpireArgs
- java.lang.Object
-
- io.lettuce.core.ExpireArgs
-
- All Implemented Interfaces:
CompositeArgument
public class ExpireArgs extends Object implements CompositeArgument
Argument list builder for the Redis EXPIRE commands (PEXPIRE, EXPIREAT, PEXPIREAT). Static import the methods fromExpireArgs.Builder
and call the methods:xx(…)
gt(…)
.ExpireArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.2
- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpireArgs.Builder
Builder entry points forExpireArgs
.
-
Constructor Summary
Constructors Constructor Description ExpireArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.ExpireArgs
gt()
Set expiry only when the new expiry is greater than current one.ExpireArgs
lt()
Set expiry only when the new expiry is less than current one.ExpireArgs
nx()
Set expiry only when the key has no expiry.ExpireArgs
xx()
Set expiry only when the key has an existing expiry.
-
-
-
Method Detail
-
nx
public ExpireArgs nx()
Set expiry only when the key has no expiry.- Returns:
this
.
-
xx
public ExpireArgs xx()
Set expiry only when the key has an existing expiry.- Returns:
this
.
-
gt
public ExpireArgs gt()
Set expiry only when the new expiry is greater than current one.- Returns:
this
.
-
lt
public ExpireArgs lt()
Set expiry only when the new expiry is less than current one.- Returns:
this
.
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build 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:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-