Class Range<T>
java.lang.Object
org.springframework.data.elasticsearch.core.Range<T>
Simple value object to work with ranges and boundaries.
- Since:
- 4.3
- Author:
- Sascha Woo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classValue object representing a boundary. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Range<T>closed(T from, T to) Creates a newRangewith inclusive bounds for both values.booleanReturns whether theRangecontains the given value.booleaninthashCode()static <T> Range<T>just(T value) Creates a new Range with the given value as sole member.static <T> Range<T>leftOpen(T from, T to) Creates a new left-openRange, i.e. left exclusive, right inclusive.static <T> Range<T>leftUnbounded(Range.Bound<T> to) Creates a left-unboundedRange(the left bound set toRange.Bound.unbounded()) with the given right bound.static <T> Range<T>of(Range.Bound<T> lowerBound, Range.Bound<T> upperBound) Creates a newRangewith the given lower and upper bound.static <T> Range<T>open(T from, T to) Creates a newRangewith exclusive bounds for both values.static <T> Range<T>rightOpen(T from, T to) Creates a new right-openRange, i.e. left inclusive, right exclusive.static <T> Range<T>rightUnbounded(Range.Bound<T> from) Creates a right-unboundedRange(the right bound set toRange.Bound.unbounded()) with the given left bound.toString()static <T> Range<T>Returns an unboundedRange.
-
Method Details
-
closed
Creates a newRangewith inclusive bounds for both values.- Type Parameters:
T-- Parameters:
from- must not be null.to- must not be null.- Returns:
-
just
Creates a new Range with the given value as sole member.- Type Parameters:
T-- Parameters:
value- must not be null.- Returns:
- See Also:
-
leftOpen
Creates a new left-openRange, i.e. left exclusive, right inclusive.- Type Parameters:
T-- Parameters:
from- must not be null.to- must not be null.- Returns:
-
leftUnbounded
Creates a left-unboundedRange(the left bound set toRange.Bound.unbounded()) with the given right bound.- Type Parameters:
T-- Parameters:
to- the rightRange.Bound, must not be null.- Returns:
-
of
Creates a newRangewith the given lower and upper bound.- Parameters:
lowerBound- must not be null.upperBound- must not be null.
-
open
Creates a newRangewith exclusive bounds for both values.- Type Parameters:
T-- Parameters:
from- must not be null.to- must not be null.- Returns:
-
rightOpen
Creates a new right-openRange, i.e. left inclusive, right exclusive.- Type Parameters:
T-- Parameters:
from- must not be null.to- must not be null.- Returns:
-
rightUnbounded
Creates a right-unboundedRange(the right bound set toRange.Bound.unbounded()) with the given left bound.- Type Parameters:
T-- Parameters:
from- the leftRange.Bound, must not be null.- Returns:
-
unbounded
Returns an unboundedRange.- Returns:
-
contains
Returns whether theRangecontains the given value.- Parameters:
value- must not be null.- Returns:
-
equals
-
getLowerBound
-
getUpperBound
-
hashCode
public int hashCode() -
toString
-