java.lang.Object
io.lettuce.core.SortArgs
- All Implemented Interfaces:
CompositeArgument
public class SortArgs extends Object implements CompositeArgument
Argument list builder for the Redis SORT command. Static import the methods from
SortArgs.Builder and chain the method calls: by("weight_*").desc().limit(0, 2).
ScanArgs is a mutable object and instances should be used only once to avoid shared mutable state.
- Author:
- Will Glozer, Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSortArgs.BuilderBuilder entry points forSortArgs. -
Constructor Summary
Constructors Constructor Description SortArgs() -
Method Summary
Modifier and Type Method Description SortArgsalpha()Apply lexicographically sort.SortArgsasc()Apply numeric sort in ascending order.<K, V> voidbuild(CommandArgs<K,V> args)Build command arguments and contribute arguments toCommandArgs.SortArgsby(String pattern)Sort keys by an external list.SortArgsdesc()Apply numeric sort in descending order.SortArgsget(String pattern)Retrieve external keys during sort.SortArgslimit(long offset, long count)Limit the number of returned elements.SortArgslimit(Limit limit)Limit the number of returned elements.
-
Constructor Details
-
SortArgs
public SortArgs()
-
-
Method Details
-
by
Sort keys by an external list. Key names are obtained substituting the first occurrence of*with the actual value of the element in the list.- Parameters:
pattern- key name pattern.- Returns:
thisSortArgs.
-
limit
Limit the number of returned elements.- Parameters:
offset-count-- Returns:
thisSortArgs.
-
limit
Limit the number of returned elements.- Parameters:
limit- must not benull.- Returns:
thisSortArgs.
-
get
Retrieve external keys during sort. GET supports#and*wildcards.- Parameters:
pattern- must not benull.- Returns:
thisSortArgs.
-
asc
Apply numeric sort in ascending order.- Returns:
thisSortArgs.
-
desc
Apply numeric sort in descending order.- Returns:
thisSortArgs.
-
alpha
Apply lexicographically sort.- Returns:
thisSortArgs.
-
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.
-