Package io.lettuce.core
Class Range<T>
- java.lang.Object
-
- io.lettuce.core.Range<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Range.Boundary<T>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Range<T>
create(T lower, T upper)
Create a new range fromlower
andupper
boundary values.boolean
equals(Object o)
static <T> Range<T>
from(Range.Boundary<T> lower, Range.Boundary<T> upper)
Create a new range fromlower
andupper
boundaries.Range.Boundary<T>
getLower()
Range.Boundary<T>
getUpper()
Range<T>
gt(T lower)
Greater thanlower
.Range<T>
gte(T lower)
Greater than or equalslower
.int
hashCode()
boolean
isUnbounded()
Return whether thisRange
is unbounded (i.e.Range<T>
lt(T upper)
Less thanlower
.Range<T>
lte(T upper)
Less than or equalslower
.String
toString()
static <T> Range<T>
unbounded()
-
-
-
Method Detail
-
create
public static <T> Range<T> create(T lower, T upper)
Create a new range fromlower
andupper
boundary 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
public static <T> Range<T> from(Range.Boundary<T> lower, Range.Boundary<T> upper)
Create a new range fromlower
andupper
boundaries.- Type Parameters:
T
- value type.- Parameters:
lower
- lower boundary, must not benull
.upper
- upper boundary, must not benull
.- Returns:
- new
Range
-
unbounded
public static <T> Range<T> unbounded()
- Type Parameters:
T
- value type.- Returns:
- new
Range
withlower
andupper
set toRange.Boundary.unbounded()
.
-
gte
public Range<T> gte(T lower)
Greater than or equalslower
.- Parameters:
lower
- the lower boundary value.- Returns:
this
Range
withlower
applied.
-
gt
public Range<T> gt(T lower)
Greater thanlower
.- Parameters:
lower
- the lower boundary value.- Returns:
this
Range
withlower
applied.
-
lte
public Range<T> lte(T upper)
Less than or equalslower
.- Parameters:
upper
- the upper boundary value.- Returns:
this
Range
withupper
applied.
-
lt
public Range<T> lt(T upper)
Less thanlower
.- Parameters:
upper
- the upper boundary value.- Returns:
this
Range
withupper
applied.
-
isUnbounded
public boolean isUnbounded()
Return whether thisRange
is unbounded (i.e. upper and lower bounds are unbounded).- Returns:
- whether this
Range
is unbounded - Since:
- 6.0
-
getLower
public Range.Boundary<T> getLower()
- Returns:
- the lower boundary.
-
getUpper
public Range.Boundary<T> getUpper()
- Returns:
- the upper boundary.
-
-