|
|
|
@ -28,7 +28,11 @@ import org.springframework.lang.Nullable; |
|
|
|
* over using {@literal null} or {@link java.util.Optional#empty()} to indicate the absence of an actual {@link Limit}. |
|
|
|
* over using {@literal null} or {@link java.util.Optional#empty()} to indicate the absence of an actual {@link Limit}. |
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* {@link Limit} itself does not make assumptions about the actual {@link #max()} value sign. This means that a negative |
|
|
|
* {@link Limit} itself does not make assumptions about the actual {@link #max()} value sign. This means that a negative |
|
|
|
* value may be valid within a defined context. |
|
|
|
* value may be valid within a defined context. A zero limit can be useful in cases where the result is not needed but |
|
|
|
|
|
|
|
* the underlying activity to compute results might be required. |
|
|
|
|
|
|
|
* <p> |
|
|
|
|
|
|
|
* Note that using a zero Limit with repository query methods returning {@link Page} is rejected because of a zero-page |
|
|
|
|
|
|
|
* size. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Christoph Strobl |
|
|
|
* @author Christoph Strobl |
|
|
|
* @author Oliver Drotbohm |
|
|
|
* @author Oliver Drotbohm |
|
|
|
@ -104,8 +108,7 @@ public sealed interface Limit permits Limited, Unlimited { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return this.isUnlimited() && that.isUnlimited() |
|
|
|
return this.isUnlimited() && that.isUnlimited() || max() == that.max(); |
|
|
|
|| max() == that.max(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
|