Package io.lettuce.core
Class ScanArgs
- 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 fromScanArgs.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 class
ScanArgs.Builder
Builder entry points forScanArgs
.
-
Constructor Summary
Constructors Constructor Description ScanArgs()
-
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
.ScanArgs
limit(long count)
Limit the scan by countScanArgs
match(byte[] match)
Set the match filter.ScanArgs
match(String match)
Set the match filter.ScanArgs
match(String match, Charset charset)
Set the match filter along the givenCharset
.
-
-
-
Method Detail
-
match
public ScanArgs match(String match)
Set the match filter. UsesUTF-8
to encodematch
.- Parameters:
match
- the filter, must not benull
.- Returns:
- this
ScanArgs
.
-
match
public ScanArgs match(String match, Charset charset)
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
public ScanArgs match(byte[] match)
Set the match filter.- Parameters:
match
- the filter, must not benull
.- Returns:
- this
ScanArgs
. - Since:
- 6.0.4
-
limit
public ScanArgs limit(long count)
Limit the scan by count- Parameters:
count
- number of elements to scan- Returns:
- this
ScanArgs
.
-
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
.
-
-