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
from
RestoreArgs.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 classRestoreArgs.BuilderBuilder entry points forXAddArgs. -
Constructor Summary
Constructors Constructor Description RestoreArgs() -
Method Summary
Modifier and Type Method Description RestoreArgsabsttl()TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.RestoreArgsabsttl(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.RestoreArgsfrequency(long frequency)Set the logarithmic access frequency counter of the object stored at the specified key.RestoreArgsidleTime(long idleTime)Set the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).RestoreArgsreplace()Replaces existing keys if the target key already exists.RestoreArgsreplace(boolean replace)Replaces existing keys if the target key already exists.RestoreArgsttl(long milliseconds)Set TTL inmillisecondsafter restoring the key.RestoreArgsttl(Duration ttl)Set TTL inmillisecondsafter restoring the key.
-
Constructor Details
-
RestoreArgs
public RestoreArgs()
-
-
Method Details
-
ttl
Set TTL inmillisecondsafter restoring the key.- Parameters:
milliseconds- time to live.- Returns:
this.
-
ttl
Set TTL inmillisecondsafter restoring the key.- Parameters:
ttl- time to live.- Returns:
this.
-
replace
Replaces existing keys if the target key already exists.- Returns:
this.
-
replace
Replaces existing keys if the target key already exists.- Parameters:
replace-trueto enable replacing of existing keys.- Returns:
this.
-
absttl
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.- Returns:
this.- Since:
- 6.1
-
absttl
TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.- Parameters:
absttl-trueto apply absolute TTL instead of a relative remaining TTL.- Returns:
this.- Since:
- 6.1
-
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
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
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.
-