Package io.lettuce.core
Class KeyScanArgs
- java.lang.Object
-
- io.lettuce.core.ScanArgs
-
- io.lettuce.core.KeyScanArgs
-
- All Implemented Interfaces:
CompositeArgument
public class KeyScanArgs extends ScanArgs
Argument list builder for the RedisSCAN
command. Static import the methods fromKeyScanArgs.Builder
and chain the method calls:type("string").limit(2)
.KeyScanArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.1
- Author:
- Mykola Makhin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyScanArgs.Builder
-
Constructor Summary
Constructors Constructor Description KeyScanArgs()
-
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
.KeyScanArgs
limit(long count)
Limit the scan by countKeyScanArgs
match(String match)
Set the match filter.KeyScanArgs
match(String match, Charset charset)
Set the match filter along the givenCharset
.KeyScanArgs
type(String type)
Return keys only of specified type.
-
-
-
Method Detail
-
type
public KeyScanArgs type(String type)
Return keys only of specified type.- Parameters:
type
- of keys as returned by TYPE command- Returns:
- this
KeyScanArgs
.
-
match
public KeyScanArgs match(String match)
Set the match filter. UsesUTF-8
to encodematch
.
-
match
public KeyScanArgs match(String match, Charset charset)
Set the match filter along the givenCharset
.
-
limit
public KeyScanArgs limit(long count)
Limit the scan by count
-
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
- Overrides:
build
in classScanArgs
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-