Browse Source

Improve Pageable Javadoc.

Closes #2679
pull/2681/head
Mark Paluch 3 years ago
parent
commit
a73b0d9936
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 16
      src/main/java/org/springframework/data/domain/Pageable.java

16
src/main/java/org/springframework/data/domain/Pageable.java

@ -68,21 +68,27 @@ public interface Pageable { @@ -68,21 +68,27 @@ public interface Pageable {
/**
* Returns the page to be returned.
*
* @return the page to be returned.
* @return the page to be returned or throws {@link UnsupportedOperationException} if the object is
* {@link #isUnpaged()}.
* @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
*/
int getPageNumber();
/**
* Returns the number of items to be returned.
*
* @return the number of items of that page
* @return the number of items of that page or throws {@link UnsupportedOperationException} if the object is
* {@link #isUnpaged()}.
* @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
*/
int getPageSize();
/**
* Returns the offset to be taken according to the underlying page and page size.
*
* @return the offset to be taken
* @return the offset to be taken or throws {@link UnsupportedOperationException} if the object is
* {@link #isUnpaged()}.
* @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
*/
long getOffset();
@ -131,8 +137,10 @@ public interface Pageable { @@ -131,8 +137,10 @@ public interface Pageable {
* Creates a new {@link Pageable} with {@code pageNumber} applied.
*
* @param pageNumber
* @return a new {@link PageRequest}.
* @return a new {@link PageRequest} or throws {@link UnsupportedOperationException} if the object is
* {@link #isUnpaged()} and the {@code pageNumber} is not zero.
* @since 2.5
* @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
*/
Pageable withPage(int pageNumber);

Loading…
Cancel
Save