Skip to content

Commit 7f0846f

Browse files
committed
Polishing.
Consistent wording for pageable and sort arguments. See #2574
1 parent 35297df commit 7f0846f

9 files changed

+29
-17
lines changed

src/main/java/org/springframework/data/repository/PagingAndSortingRepository.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ public interface PagingAndSortingRepository<T, ID> extends CrudRepository<T, ID>
3434
/**
3535
* Returns all entities sorted by the given options.
3636
*
37-
* @param sort
37+
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
38+
* {@literal null}.
3839
* @return all entities sorted by the given options
3940
*/
4041
Iterable<T> findAll(Sort sort);
4142

4243
/**
43-
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
44+
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
4445
*
45-
* @param pageable must not be {@literal null}.
46+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
47+
* {@literal null}.
4648
* @return a page of entities
4749
*/
4850
Page<T> findAll(Pageable pageable);

src/main/java/org/springframework/data/repository/history/RevisionRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public interface RevisionRepository<T, ID, N extends Number & Comparable<N>> ext
5555
* implementations have to support sorting by all properties.
5656
*
5757
* @param id must not be {@literal null}.
58-
* @param pageable
58+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
59+
* {@literal null}.
5960
* @see RevisionSort
6061
* @return
6162
*/

src/main/java/org/springframework/data/repository/query/FluentQuery.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public interface FluentQuery<T> {
4141
/**
4242
* Define the sort order.
4343
*
44-
* @param sort must not be {@code null}.
44+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
45+
* {@literal null}.
4546
* @return a new instance of {@link FluentQuery}.
4647
* @throws IllegalArgumentException if resultType is {@code null}.
4748
*/
@@ -146,8 +147,9 @@ default Optional<T> first() {
146147
/**
147148
* Get a page of matching elements for {@link Pageable}.
148149
*
149-
* @param pageable must not be {@code null}. The given {@link Pageable} will override any previously specified
150-
* {@link Sort sort} if the {@link Sort} object is not {@link Sort#isUnsorted()}.
150+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
151+
* {@literal null}. The given {@link Pageable} will override any previously specified {@link Sort sort} if
152+
* the {@link Sort} object is not {@link Sort#isUnsorted()}.
151153
* @return
152154
*/
153155
Page<T> page(Pageable pageable);
@@ -221,8 +223,9 @@ default ReactiveFluentQuery<T> project(String... properties) {
221223
/**
222224
* Get a page of matching elements for {@link Pageable}.
223225
*
224-
* @param pageable must not be {@code null}. The given {@link Pageable} will override any previously specified
225-
* {@link Sort sort} if the {@link Sort} object is not {@link Sort#isUnsorted()}.
226+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
227+
* {@literal null}. The given {@link Pageable} will override any previously specified {@link Sort sort} if
228+
* the {@link Sort} object is not {@link Sort#isUnsorted()}.
226229
* @return
227230
*/
228231
Mono<Page<T>> page(Pageable pageable);

src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public interface QueryByExampleExecutor<T> {
5757
* found an empty {@link Iterable} is returned.
5858
*
5959
* @param example must not be {@literal null}.
60-
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
60+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
61+
* {@literal null}.
6162
* @return all entities matching the given {@link Example}.
6263
* @since 1.10
6364
*/
@@ -68,7 +69,8 @@ public interface QueryByExampleExecutor<T> {
6869
* {@link Page} is returned.
6970
*
7071
* @param example must not be {@literal null}.
71-
* @param pageable must not be {@literal null}.
72+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
73+
* {@literal null}.
7274
* @return a {@link Page} of entities matching the given {@link Example}.
7375
*/
7476
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);

src/main/java/org/springframework/data/repository/query/ReactiveQueryByExampleExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public interface ReactiveQueryByExampleExecutor<T> {
5959
* found {@link Flux#empty()} is returned.
6060
*
6161
* @param example must not be {@literal null}.
62-
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
62+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
63+
* {@literal null}.
6364
* @return all entities matching the given {@link Example}.
6465
*/
6566
<S extends T> Flux<S> findAll(Example<S> example, Sort sort);

src/main/java/org/springframework/data/repository/reactive/ReactiveSortingRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public interface ReactiveSortingRepository<T, ID> extends ReactiveCrudRepository
3838
/**
3939
* Returns all entities sorted by the given options.
4040
*
41-
* @param sort must not be {@literal null}.
41+
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
42+
* {@literal null}.
4243
* @return all entities sorted by the given options.
4344
* @throws IllegalArgumentException in case the given {@link Sort} is {@literal null}.
4445
*/

src/main/java/org/springframework/data/repository/reactive/RxJava2SortingRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public interface RxJava2SortingRepository<T, ID> extends RxJava2CrudRepository<T
3838
/**
3939
* Returns all entities sorted by the given options.
4040
*
41-
* @param sort must not be {@literal null}.
41+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
42+
* {@literal null}.
4243
* @return all entities sorted by the given options.
4344
*/
4445
Flowable<T> findAll(Sort sort);

src/main/java/org/springframework/data/repository/reactive/RxJava3SortingRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public interface RxJava3SortingRepository<T, ID> extends RxJava3CrudRepository<T
3636
/**
3737
* Returns all entities sorted by the given options.
3838
*
39-
* @param sort must not be {@literal null}.
39+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
40+
* {@literal null}.
4041
* @return all entities sorted by the given options.
4142
*/
4243
Flowable<T> findAll(Sort sort);

src/main/java/org/springframework/data/repository/support/RepositoryInvoker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface RepositoryInvoker extends RepositoryInvocationInformation {
6060
* contained in the given {@link Pageable}) or the plain equivalent to
6161
* {@link org.springframework.data.repository.CrudRepository#findAll()}.
6262
*
63-
* @param pageable can be {@literal null}.
63+
* @param pageable must not be {@literal null}.
6464
* @return the result of the invocation of the find-all method.
6565
* @throws IllegalStateException if the repository does not expose a find-all-method.
6666
*/
@@ -72,7 +72,7 @@ public interface RepositoryInvoker extends RepositoryInvocationInformation {
7272
* {@link org.springframework.data.repository.PagingAndSortingRepository#findAll(Sort)}) or the plain equivalent to
7373
* {@link org.springframework.data.repository.CrudRepository#findAll()}.
7474
*
75-
* @param sort can be {@literal null}.
75+
* @param sort must not be {@literal null}.
7676
* @return the result of the invocation of the find-all method.
7777
* @throws IllegalStateException if the repository does not expose a find-all-method.
7878
*/

0 commit comments

Comments
 (0)