Package io.lettuce.core
Class GetExArgs
- java.lang.Object
-
- io.lettuce.core.GetExArgs
-
- All Implemented Interfaces:
CompositeArgument
public class GetExArgs extends Object implements CompositeArgument
Argument list builder for the Redis GETEX command starting from Redis 6.2. Static import the methods fromGetExArgs.Builder
and chain the method calls:ex(10).nx()
.GetExArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.1
- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GetExArgs.Builder
Builder entry points forGetExArgs
.
-
Constructor Summary
Constructors Constructor Description GetExArgs()
-
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
.GetExArgs
ex(long timeout)
Set the specified expire time, in seconds.GetExArgs
ex(Duration timeout)
Set the specified expire time, in seconds.GetExArgs
exAt(long timestamp)
Set the specified expire at time using a posixtimestamp
.GetExArgs
exAt(Instant timestamp)
Set the specified expire at time using a posixtimestamp
.GetExArgs
exAt(Date timestamp)
Set the specified expire at time using a posixtimestamp
.GetExArgs
persist()
Remove the time to live associated with the key.GetExArgs
px(long timeout)
Set the specified expire time, in milliseconds.GetExArgs
px(Duration timeout)
Set the specified expire time, in milliseconds.GetExArgs
pxAt(long timestamp)
Set the specified expire at time using a posixtimestamp
.GetExArgs
pxAt(Instant timestamp)
Set the specified expire at time using a posixtimestamp
.GetExArgs
pxAt(Date timestamp)
Set the specified expire at time using a posixtimestamp
.
-
-
-
Method Detail
-
ex
public GetExArgs ex(long timeout)
Set the specified expire time, in seconds.- Parameters:
timeout
- expire time in seconds.- Returns:
this
GetExArgs
.
-
ex
public GetExArgs ex(Duration timeout)
Set the specified expire time, in seconds.- Parameters:
timeout
- expire time in seconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
exAt
public GetExArgs exAt(long timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in seconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
exAt
public GetExArgs exAt(Date timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in seconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
exAt
public GetExArgs exAt(Instant timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in seconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
px
public GetExArgs px(long timeout)
Set the specified expire time, in milliseconds.- Parameters:
timeout
- expire time in milliseconds.- Returns:
this
GetExArgs
.
-
px
public GetExArgs px(Duration timeout)
Set the specified expire time, in milliseconds.- Parameters:
timeout
- expire time in milliseconds.- Returns:
this
GetExArgs
.
-
pxAt
public GetExArgs pxAt(long timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in milliseconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
pxAt
public GetExArgs pxAt(Date timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in milliseconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
pxAt
public GetExArgs pxAt(Instant timestamp)
Set the specified expire at time using a posixtimestamp
.- Parameters:
timestamp
- the timestamp type: posix time in milliseconds.- Returns:
this
GetExArgs
.- Since:
- 6.1
-
persist
public GetExArgs persist()
Remove the time to live associated with the key.- Returns:
this
GetExArgs
.
-
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
.
-
-