Package org.springframework.data.domain
Interface Limit
- All Known Implementing Classes:
Limit.Limited
,Limit.Unlimited
Limit
represents the maximum value up to which an operation should continue processing. It may be used for
defining the maximum
number of results within a repository finder method or if applicable a template
operation.
A isUnlimited()
is used to indicate that there is no Limit
defined, which should be favoured
over using null or Optional.empty()
to indicate the absence of an actual Limit
.
Limit
itself does not make assumptions about the actual max()
value sign. This means that a negative
value may be valid within a defined context.- Since:
- 3.2
- Author:
- Christoph Strobl
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
static final class
-
Method Summary
-
Method Details
-
unlimited
- Returns:
- a
Limit
instance that does not definemax()
and answersisUnlimited()
with true.
-
of
Create a newLimit
from the given max value.- Parameters:
max
- the maximum value.- Returns:
- new instance of
Limit
.
-
max
int max()- Returns:
- the max number of potential results.
-
isLimited
boolean isLimited()- Returns:
- true if limiting (maximum value) should be applied.
-
isUnlimited
default boolean isUnlimited()- Returns:
- true if no limiting (maximum value) should be applied.
-