Package io.lettuce.core
Class CopyArgs
- java.lang.Object
-
- io.lettuce.core.CopyArgs
-
- All Implemented Interfaces:
CompositeArgument
public class CopyArgs extends Object implements CompositeArgument
Argument list builder for the Redis COPY command. Static import the methods fromCopyArgs.Builder
and call the methods:destinationDb(…)
replace(…)
.CopyArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.1
- Author:
- Bartek Kowalczyk
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CopyArgs.Builder
Builder entry points forCopyArgs
.
-
Constructor Summary
Constructors Constructor Description CopyArgs()
-
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
.CopyArgs
destinationDb(long destinationDb)
Specify an alternative logical database index for the destination key.CopyArgs
replace(boolean replace)
Hint redis to remove the destination key before copying the value to it.
-
-
-
Method Detail
-
destinationDb
public CopyArgs destinationDb(long destinationDb)
Specify an alternative logical database index for the destination key.- Parameters:
destinationDb
- logical database index to apply for DB.- Returns:
this
.
-
replace
public CopyArgs replace(boolean replace)
Hint redis to remove the destination key before copying the value to it.- Parameters:
replace
- remove destination key before copying the value REPLACE.- 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
.
-
-