Package io.lettuce.core
Class RestoreArgs
- java.lang.Object
-
- io.lettuce.core.RestoreArgs
-
- All Implemented Interfaces:
CompositeArgument
public class RestoreArgs extends Object implements CompositeArgument
Argument list builder for the Redis RESTORE command. Static import the methods fromRestoreArgs.Builder
and call the methods:ttl(…)
.RestoreArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 5.1
- Author:
- Mark Paluch, dengliming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestoreArgs.Builder
Builder entry points forXAddArgs
.
-
Constructor Summary
Constructors Constructor Description RestoreArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestoreArgs
absttl()
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.RestoreArgs
absttl(boolean absttl)
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.RestoreArgs
frequency(long frequency)
Set the logarithmic access frequency counter of the object stored at the specified key.RestoreArgs
idleTime(long idleTime)
Set the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).RestoreArgs
replace()
Replaces existing keys if the target key already exists.RestoreArgs
replace(boolean replace)
Replaces existing keys if the target key already exists.RestoreArgs
ttl(long milliseconds)
Set TTL inmilliseconds
after restoring the key.RestoreArgs
ttl(Duration ttl)
Set TTL inmilliseconds
after restoring the key.
-
-
-
Method Detail
-
ttl
public RestoreArgs ttl(long milliseconds)
Set TTL inmilliseconds
after restoring the key.- Parameters:
milliseconds
- time to live.- Returns:
this
.
-
ttl
public RestoreArgs ttl(Duration ttl)
Set TTL inmilliseconds
after restoring the key.- Parameters:
ttl
- time to live.- Returns:
this
.
-
replace
public RestoreArgs replace()
Replaces existing keys if the target key already exists.- Returns:
this
.
-
replace
public RestoreArgs replace(boolean replace)
Replaces existing keys if the target key already exists.- Parameters:
replace
-true
to enable replacing of existing keys.- Returns:
this
.
-
absttl
public RestoreArgs absttl()
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.- Returns:
this
.- Since:
- 6.1
-
absttl
public RestoreArgs absttl(boolean absttl)
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.- Parameters:
absttl
-true
to apply absolute TTL instead of a relative remaining TTL.- Returns:
this
.- Since:
- 6.1
-
idleTime
public RestoreArgs idleTime(long idleTime)
Set the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).- Parameters:
idleTime
- the idle time when using a LRU eviction policy.- Returns:
this
.- Since:
- 6.1
-
frequency
public RestoreArgs frequency(long frequency)
Set the logarithmic access frequency counter of the object stored at the specified key.- Parameters:
frequency
- the access frequency when using a LFU eviction policy.- Returns:
this
.- Since:
- 6.1
-
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
.
-
-