java.lang.Object
io.lettuce.core.Range<T>
public class Range<T> extends Object
Range defines lower and upper boundaries to retrieve items from a sorted set.- Since:
- 4.3
- Author:
- Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRange.Boundary<T> -
Method Summary
Modifier and Type Method Description static <T> Range<T>create(T lower, T upper)Create a new range fromlowerandupperboundary values.booleanequals(Object o)static <T> Range<T>from(Range.Boundary<T> lower, Range.Boundary<T> upper)Create a new range fromlowerandupperboundaries.Range.Boundary<T>getLower()Range.Boundary<T>getUpper()Range<T>gt(T lower)Greater thanlower.Range<T>gte(T lower)Greater than or equalslower.inthashCode()booleanisUnbounded()Return whether thisRangeis unbounded (i.e.Range<T>lt(T upper)Less thanlower.Range<T>lte(T upper)Less than or equalslower.StringtoString()static <T> Range<T>unbounded()
-
Method Details
-
create
Create a new range fromlowerandupperboundary values. Both values are included (greater than or equals and less than or equals).- Type Parameters:
T- value type- Parameters:
lower- lower boundary, must not benull.upper- upper boundary, must not benull.- Returns:
- new
Range
-
from
Create a new range fromlowerandupperboundaries.- Type Parameters:
T- value type.- Parameters:
lower- lower boundary, must not benull.upper- upper boundary, must not benull.- Returns:
- new
Range
-
unbounded
- Type Parameters:
T- value type.- Returns:
- new
Rangewithlowerandupperset toRange.Boundary.unbounded().
-
gte
Greater than or equalslower.- Parameters:
lower- the lower boundary value.- Returns:
thisRangewithlowerapplied.
-
gt
Greater thanlower.- Parameters:
lower- the lower boundary value.- Returns:
thisRangewithlowerapplied.
-
lte
Less than or equalslower.- Parameters:
upper- the upper boundary value.- Returns:
thisRangewithupperapplied.
-
lt
Less thanlower.- Parameters:
upper- the upper boundary value.- Returns:
thisRangewithupperapplied.
-
isUnbounded
public boolean isUnbounded()Return whether thisRangeis unbounded (i.e. upper and lower bounds are unbounded).- Returns:
- whether this
Rangeis unbounded - Since:
- 6.0
-
getLower
- Returns:
- the lower boundary.
-
getUpper
- Returns:
- the upper boundary.
-
equals
-
hashCode
public int hashCode() -
toString
-