@Experimental public class Limit extends Object implements PostProcessingOperation
{
@code
// Get first 10 results
Limit limit = Limit.of(0, 10);
// Get results 50-100
Limit paginated = Limit.of(50, 50);
}
PostProcessingOperation| Constructor and Description |
|---|
Limit(long offset,
long num)
Creates a new LIMIT operation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
build(CommandArgs<?,?> args)
Build the operation arguments into the command args.
|
long |
getNum()
Get the number of results.
|
long |
getOffset()
Get the offset.
|
static Limit |
of(long offset,
long num)
Static factory method to create a Limit instance.
|
public Limit(long offset,
long num)
offset - the zero-based starting indexnum - the maximum number of results to returnpublic static Limit of(long offset, long num)
offset - the zero-based starting indexnum - the maximum number of results to returnpublic long getOffset()
public long getNum()
public void build(CommandArgs<?,?> args)
PostProcessingOperationbuild in interface PostProcessingOperationargs - the command args to build intoCopyright © 2026 lettuce.io. All rights reserved.