@@ -68,21 +68,27 @@ default boolean isUnpaged() {
68
68
/**
69
69
* Returns the page to be returned.
70
70
*
71
- * @return the page to be returned.
71
+ * @return the page to be returned or throws {@link UnsupportedOperationException} if the object is
72
+ * {@link #isUnpaged()}.
73
+ * @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
72
74
*/
73
75
int getPageNumber ();
74
76
75
77
/**
76
78
* Returns the number of items to be returned.
77
79
*
78
- * @return the number of items of that page
80
+ * @return the number of items of that page or throws {@link UnsupportedOperationException} if the object is
81
+ * {@link #isUnpaged()}.
82
+ * @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
79
83
*/
80
84
int getPageSize ();
81
85
82
86
/**
83
87
* Returns the offset to be taken according to the underlying page and page size.
84
88
*
85
- * @return the offset to be taken
89
+ * @return the offset to be taken or throws {@link UnsupportedOperationException} if the object is
90
+ * {@link #isUnpaged()}.
91
+ * @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
86
92
*/
87
93
long getOffset ();
88
94
@@ -131,8 +137,10 @@ default Sort getSortOr(Sort sort) {
131
137
* Creates a new {@link Pageable} with {@code pageNumber} applied.
132
138
*
133
139
* @param pageNumber
134
- * @return a new {@link PageRequest}.
140
+ * @return a new {@link PageRequest} or throws {@link UnsupportedOperationException} if the object is
141
+ * {@link #isUnpaged()} and the {@code pageNumber} is not zero.
135
142
* @since 2.5
143
+ * @throws UnsupportedOperationException if the object is {@link #isUnpaged()}.
136
144
*/
137
145
Pageable withPage (int pageNumber );
138
146
0 commit comments