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 favored
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, Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final class -
Method Summary
-
Method Details
-
unlimited
- Returns:
- a
Limitinstance that does not definemax()and answersisUnlimited()with true.
-
of
Create a newLimitfrom 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.
-