diff --git a/src/main/java/org/springframework/data/domain/PageRequest.java b/src/main/java/org/springframework/data/domain/PageRequest.java index fcaff8f4f..53da6249c 100644 --- a/src/main/java/org/springframework/data/domain/PageRequest.java +++ b/src/main/java/org/springframework/data/domain/PageRequest.java @@ -50,8 +50,8 @@ public class PageRequest extends AbstractPageRequest { /** * Creates a new unsorted {@link PageRequest}. * - * @param page zero-based page index. - * @param size the size of the page to be returned. + * @param page zero-based page index, must not be negative. + * @param size the size of the page to be returned, must be greater than 0. * @since 2.0 */ public static PageRequest of(int page, int size) { @@ -73,8 +73,8 @@ public class PageRequest extends AbstractPageRequest { /** * Creates a new {@link PageRequest} with sort direction and properties applied. * - * @param page zero-based page index. - * @param size the size of the page to be returned. + * @param page zero-based page index, must not be negative. + * @param size the size of the page to be returned, must be greater than 0. * @param direction must not be {@literal null}. * @param properties must not be {@literal null}. * @since 2.0 diff --git a/src/main/java/org/springframework/data/querydsl/QPageRequest.java b/src/main/java/org/springframework/data/querydsl/QPageRequest.java index 19fef992d..928079835 100644 --- a/src/main/java/org/springframework/data/querydsl/QPageRequest.java +++ b/src/main/java/org/springframework/data/querydsl/QPageRequest.java @@ -37,8 +37,8 @@ public class QPageRequest extends AbstractPageRequest { * Creates a new {@link QPageRequest}. Pages are zero indexed, thus providing 0 for {@code page} will return the first * page. * - * @param page - * @param size + * @param page must not be negative. + * @param size must be greater or equal to 0. */ public QPageRequest(int page, int size) { this(page, size, QSort.unsorted()); @@ -47,8 +47,8 @@ public class QPageRequest extends AbstractPageRequest { /** * Creates a new {@link QPageRequest} with the given {@link OrderSpecifier}s applied. * - * @param page - * @param size + * @param page must not be negative. + * @param size must be greater or equal to 0. * @param orderSpecifiers must not be {@literal null} or empty; */ public QPageRequest(int page, int size, OrderSpecifier... orderSpecifiers) {