Package io.lettuce.core
Class Limit
- java.lang.Object
-
- io.lettuce.core.Limit
-
public class Limit extends Object
Value object for a slice of data (offset/count).- Since:
- 4.2
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Limit
create(long offset, long count)
static Limit
from(long count)
Creates aLimit
givencount
.long
getCount()
long
getOffset()
boolean
isLimited()
String
toString()
static Limit
unlimited()
-
-
-
Method Detail
-
unlimited
public static Limit unlimited()
- Returns:
- an unlimited limit.
-
create
public static Limit create(long offset, long count)
- Parameters:
offset
- the offset.count
- the limit count.- Returns:
- the
Limit
-
from
public static Limit from(long count)
Creates aLimit
givencount
.- Parameters:
count
- the limit count.- Returns:
- the
Limit
. - Since:
- 4.5
-
getOffset
public long getOffset()
- Returns:
- the offset or -1 if unlimited.
-
getCount
public long getCount()
- Returns:
- the count or -1 if unlimited.
-
isLimited
public boolean isLimited()
- Returns:
true
if theLimit
contains a limitation.
-
-