Polishing.

Consistent wording for pageable and sort arguments.

See #2574
This commit is contained in:
Mark Paluch
2022-03-18 15:03:53 +01:00
parent 1ea8d09b38
commit c73c0bfd6d
10 changed files with 31 additions and 18 deletions

View File

@@ -38,7 +38,8 @@ public interface ListPagingAndSortingRepository<T, ID> extends PagingAndSortingR
/**
* Returns all entities sorted by the given options.
*
* @param sort
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities sorted by the given options
*/
List<T> findAll(Sort sort);

View File

@@ -37,15 +37,17 @@ public interface PagingAndSortingRepository<T, ID> extends Repository<T, ID> {
/**
* Returns all entities sorted by the given options.
*
* @param sort
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities sorted by the given options
*/
Iterable<T> findAll(Sort sort);
/**
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
*
* @param pageable must not be {@literal null}.
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}.
* @return a page of entities
*/
Page<T> findAll(Pageable pageable);

View File

@@ -55,7 +55,8 @@ public interface RevisionRepository<T, ID, N extends Number & Comparable<N>> ext
* implementations have to support sorting by all properties.
*
* @param id must not be {@literal null}.
* @param pageable
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}.
* @see RevisionSort
* @return
*/

View File

@@ -41,7 +41,8 @@ public interface FluentQuery<T> {
/**
* Define the sort order.
*
* @param sort must not be {@code null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return a new instance of {@link FluentQuery}.
* @throws IllegalArgumentException if resultType is {@code null}.
*/
@@ -146,8 +147,9 @@ public interface FluentQuery<T> {
/**
* Get a page of matching elements for {@link Pageable}.
*
* @param pageable must not be {@code null}. The given {@link Pageable} will override any previously specified
* {@link Sort sort} if the {@link Sort} object is not {@link Sort#isUnsorted()}.
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}. The given {@link Pageable} will override any previously specified {@link Sort sort} if
* the {@link Sort} object is not {@link Sort#isUnsorted()}.
* @return
*/
Page<T> page(Pageable pageable);
@@ -221,8 +223,9 @@ public interface FluentQuery<T> {
/**
* Get a page of matching elements for {@link Pageable}.
*
* @param pageable must not be {@code null}. The given {@link Pageable} will override any previously specified
* {@link Sort sort} if the {@link Sort} object is not {@link Sort#isUnsorted()}.
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}. The given {@link Pageable} will override any previously specified {@link Sort sort} if
* the {@link Sort} object is not {@link Sort#isUnsorted()}.
* @return
*/
Mono<Page<T>> page(Pageable pageable);

View File

@@ -46,7 +46,8 @@ public interface ListQueryByExampleExecutor<T> extends QueryByExampleExecutor<T>
* found an empty {@link List} is returned.
*
* @param example must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities matching the given {@link Example}.
*/
@Override

View File

@@ -58,7 +58,8 @@ public interface QueryByExampleExecutor<T> {
* found an empty {@link Iterable} is returned.
*
* @param example must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities matching the given {@link Example}.
* @since 1.10
*/
@@ -69,7 +70,8 @@ public interface QueryByExampleExecutor<T> {
* {@link Page} is returned.
*
* @param example must not be {@literal null}.
* @param pageable must not be {@literal null}.
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}.
* @return a {@link Page} of entities matching the given {@link Example}.
*/
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);

View File

@@ -59,7 +59,8 @@ public interface ReactiveQueryByExampleExecutor<T> {
* found {@link Flux#empty()} is returned.
*
* @param example must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities matching the given {@link Example}.
*/
<S extends T> Flux<S> findAll(Example<S> example, Sort sort);

View File

@@ -42,7 +42,8 @@ public interface ReactiveSortingRepository<T, ID> extends Repository<T, ID> {
/**
* Returns all entities sorted by the given options.
*
* @param sort must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, can be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities sorted by the given options.
* @throws IllegalArgumentException in case the given {@link Sort} is {@literal null}.
*/

View File

@@ -38,7 +38,8 @@ public interface RxJava3SortingRepository<T, ID> extends Repository<T, ID> {
/**
* Returns all entities sorted by the given options.
*
* @param sort must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#unsorted()}, must not be
* {@literal null}.
* @return all entities sorted by the given options.
*/
Flowable<T> findAll(Sort sort);

View File

@@ -60,7 +60,7 @@ public interface RepositoryInvoker extends RepositoryInvocationInformation {
* contained in the given {@link Pageable}) or the plain equivalent to
* {@link org.springframework.data.repository.CrudRepository#findAll()}.
*
* @param pageable can be {@literal null}.
* @param pageable must not be {@literal null}.
* @return the result of the invocation of the find-all method.
* @throws IllegalStateException if the repository does not expose a find-all-method.
*/
@@ -72,7 +72,7 @@ public interface RepositoryInvoker extends RepositoryInvocationInformation {
* {@link org.springframework.data.repository.PagingAndSortingRepository#findAll(Sort)}) or the plain equivalent to
* {@link org.springframework.data.repository.CrudRepository#findAll()}.
*
* @param sort can be {@literal null}.
* @param sort must not be {@literal null}.
* @return the result of the invocation of the find-all method.
* @throws IllegalStateException if the repository does not expose a find-all-method.
*/