Skip to content

Commit c73c0bf

Browse files
committed
Polishing.
Consistent wording for pageable and sort arguments. See #2574
1 parent 1ea8d09 commit c73c0bf

10 files changed

+31
-18
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public interface ListPagingAndSortingRepository<T, ID> extends PagingAndSortingR
3838
/**
3939
* Returns all entities sorted by the given options.
4040
*
41-
* @param sort
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
*/
4445
List<T> findAll(Sort sort);

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ public interface PagingAndSortingRepository<T, ID> extends Repository<T, ID> {
3737
/**
3838
* Returns all entities sorted by the given options.
3939
*
40-
* @param sort
40+
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
41+
* {@literal null}.
4142
* @return all entities sorted by the given options
4243
*/
4344
Iterable<T> findAll(Sort sort);
4445

4546
/**
46-
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
47+
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
4748
*
48-
* @param pageable must not be {@literal null}.
49+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
50+
* {@literal null}.
4951
* @return a page of entities
5052
*/
5153
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/ListQueryByExampleExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public interface ListQueryByExampleExecutor<T> extends QueryByExampleExecutor<T>
4646
* found an empty {@link List} is returned.
4747
*
4848
* @param example must not be {@literal null}.
49-
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
49+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
50+
* {@literal null}.
5051
* @return all entities matching the given {@link Example}.
5152
*/
5253
@Override

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public interface QueryByExampleExecutor<T> {
5858
* found an empty {@link Iterable} is returned.
5959
*
6060
* @param example must not be {@literal null}.
61-
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
61+
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
62+
* {@literal null}.
6263
* @return all entities matching the given {@link Example}.
6364
* @since 1.10
6465
*/
@@ -69,7 +70,8 @@ public interface QueryByExampleExecutor<T> {
6970
* {@link Page} is returned.
7071
*
7172
* @param example must not be {@literal null}.
72-
* @param pageable must not be {@literal null}.
73+
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
74+
* {@literal null}.
7375
* @return a {@link Page} of entities matching the given {@link Example}.
7476
*/
7577
<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
@@ -42,7 +42,8 @@ public interface ReactiveSortingRepository<T, ID> extends Repository<T, ID> {
4242
/**
4343
* Returns all entities sorted by the given options.
4444
*
45-
* @param sort must not be {@literal null}.
45+
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
46+
* {@literal null}.
4647
* @return all entities sorted by the given options.
4748
* @throws IllegalArgumentException in case the given {@link Sort} is {@literal null}.
4849
*/

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public interface RxJava3SortingRepository<T, ID> extends Repository<T, ID> {
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/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)