K - Key type.V - Value type.@Experimental public class Limit<K,V> extends Object implements PostProcessingOperation<K,V>
{
@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<K,V> args)
Build the operation arguments into the command args.
|
long |
getNum()
Get the number of results.
|
long |
getOffset()
Get the offset.
|
static <K,V> Limit<K,V> |
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 <K,V> Limit<K,V> of(long offset, long num)
K - Key typeV - Value typeoffset - the zero-based starting indexnum - the maximum number of results to returnpublic long getOffset()
public long getNum()
public void build(CommandArgs<K,V> args)
PostProcessingOperationbuild in interface PostProcessingOperation<K,V>args - the command args to build intoCopyright © 2026 lettuce.io. All rights reserved.