java.lang.Object
io.lettuce.core.ScanArgs
- All Implemented Interfaces:
CompositeArgument
- Direct Known Subclasses:
KeyScanArgs
public class ScanArgs extends Object implements CompositeArgument
Argument list builder for the Redis scan commands (SCAN, HSCAN, SSCAN, ZSCAN). Static import the methods from
ScanArgs.Builder and chain the method calls: matches("weight_*").limit(2).
ScanArgs is a mutable object and instances should be used only once to avoid shared mutable state.
- Since:
- 3.0
- Author:
- Mark Paluch, Ge Jun
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScanArgs.BuilderBuilder entry points forScanArgs. -
Constructor Summary
Constructors Constructor Description ScanArgs() -
Method Summary
Modifier and Type Method Description <K, V> voidbuild(CommandArgs<K,V> args)Build command arguments and contribute arguments toCommandArgs.ScanArgslimit(long count)Limit the scan by countScanArgsmatch(byte[] match)Set the match filter.ScanArgsmatch(String match)Set the match filter.ScanArgsmatch(String match, Charset charset)Set the match filter along the givenCharset.
-
Constructor Details
-
ScanArgs
public ScanArgs()
-
-
Method Details
-
match
Set the match filter. UsesUTF-8to encodematch.- Parameters:
match- the filter, must not benull.- Returns:
- this
ScanArgs.
-
match
Set the match filter along the givenCharset.- Parameters:
match- the filter, must not benull.charset- the charset for match, must not benull.- Returns:
- this
ScanArgs. - Since:
- 6.0
-
match
Set the match filter.- Parameters:
match- the filter, must not benull.- Returns:
- this
ScanArgs. - Since:
- 6.0.4
-
limit
Limit the scan by count- Parameters:
count- number of elements to scan- Returns:
- this
ScanArgs.
-
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.
-