Package org.springframework.data.domain
Class Range.Bound<T>
java.lang.Object
org.springframework.data.domain.Range.Bound<T>
Value object representing a boundary. A boundary can either be
unbounded
,
including its value
or its value
.- Since:
- 2.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static Range.Bound<Double>
exclusive
(double value) Creates a boundary excludingvalue
.static Range.Bound<Float>
exclusive
(float value) Creates a boundary excludingvalue
.static Range.Bound<Integer>
exclusive
(int value) Creates a boundary excludingvalue
.static Range.Bound<Long>
exclusive
(long value) Creates a boundary excludingvalue
.static <T> Range.Bound<T>
exclusive
(T value) Creates a boundary excludingvalue
.getValue()
int
hashCode()
static Range.Bound<Double>
inclusive
(double value) Creates a boundary includingvalue
.static Range.Bound<Float>
inclusive
(float value) Creates a boundary includingvalue
.static Range.Bound<Integer>
inclusive
(int value) Creates a boundary includingvalue
.static Range.Bound<Long>
inclusive
(long value) Creates a boundary includingvalue
.static <T> Range.Bound<T>
inclusive
(T value) Creates a boundary includingvalue
.boolean
Returns whether this boundary is bounded.boolean
<R> Range.Bound<R>
Apply a mappingFunction
to the boundary value.toString()
static <T> Range.Bound<T>
Creates an unboundedRange.Bound
.
-
Method Details
-
unbounded
Creates an unboundedRange.Bound
. -
isBounded
public boolean isBounded()Returns whether this boundary is bounded.- Returns:
-
inclusive
Creates a boundary includingvalue
.- Parameters:
value
- must not be null.- Returns:
-
inclusive
Creates a boundary includingvalue
.- Parameters:
value
- must not be null.- Returns:
-
inclusive
Creates a boundary includingvalue
.- Parameters:
value
- must not be null.- Returns:
-
inclusive
Creates a boundary includingvalue
.- Parameters:
value
- must not be null.- Returns:
-
inclusive
Creates a boundary includingvalue
.- Parameters:
value
- must not be null.- Returns:
-
exclusive
Creates a boundary excludingvalue
.- Parameters:
value
- must not be null.- Returns:
-
exclusive
Creates a boundary excludingvalue
.- Parameters:
value
- must not be null.- Returns:
-
exclusive
Creates a boundary excludingvalue
.- Parameters:
value
- must not be null.- Returns:
-
exclusive
Creates a boundary excludingvalue
.- Parameters:
value
- must not be null.- Returns:
-
exclusive
Creates a boundary excludingvalue
.- Parameters:
value
- must not be null.- Returns:
-
toString
-
getValue
-
isInclusive
public boolean isInclusive() -
equals
-
hashCode
public int hashCode() -
map
Apply a mappingFunction
to the boundary value.- Type Parameters:
R
-- Parameters:
mapper
- must not be null. If the mapper returnsnull
, then the boundary value corresponds withunbounded()
.- Returns:
- a new
Range.Bound
after applying the value to the mapper. - Since:
- 3.0
-