Browse Source

DATACMNS-1184 - Fix Javadoc for non-null parameters in QuerydslPredicateExecutor.

Align Javadoc to reflect the non-null contract for Predicate arguments.

Mention unpaged/unsorted factory methods for Pageable/Sort arguments.

Related ticket: DATACMNS-1114.
pull/252/head
Mark Paluch 9 years ago
parent
commit
fc02b4fd08
  1. 20
      src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java

20
src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java

@ -30,13 +30,14 @@ import com.querydsl.core.types.Predicate; @@ -30,13 +30,14 @@ import com.querydsl.core.types.Predicate;
* @author Oliver Gierke
* @author Thomas Darimont
* @author Christoph Strobl
* @author Mark Paluch
*/
public interface QuerydslPredicateExecutor<T> {
/**
* Returns a single entity matching the given {@link Predicate} or {@link Optional#empty()} if none was found.
*
* @param predicate can be {@literal null}.
* @param predicate must not be {@literal null}.
* @return a single entity matching the given {@link Predicate} or {@link Optional#empty()} if none was found.
* @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the predicate yields more than one
* result.
@ -47,7 +48,7 @@ public interface QuerydslPredicateExecutor<T> { @@ -47,7 +48,7 @@ public interface QuerydslPredicateExecutor<T> {
* Returns all entities matching the given {@link Predicate}. In case no match could be found an empty
* {@link Iterable} is returned.
*
* @param predicate can be {@literal null}.
* @param predicate must not be {@literal null}.
* @return all entities matching the given {@link Predicate}.
*/
Iterable<T> findAll(Predicate predicate);
@ -56,8 +57,9 @@ public interface QuerydslPredicateExecutor<T> { @@ -56,8 +57,9 @@ public interface QuerydslPredicateExecutor<T> {
* Returns all entities matching the given {@link Predicate} applying the given {@link Sort}. In case no match could
* be found an empty {@link Iterable} is returned.
*
* @param predicate can be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param predicate must not be {@literal null}.
* @param sort the {@link Sort} specification to sort the results by, may be {@link Sort#empty()}, must not be
* {@literal null}.
* @return all entities matching the given {@link Predicate}.
* @since 1.10
*/
@ -67,7 +69,7 @@ public interface QuerydslPredicateExecutor<T> { @@ -67,7 +69,7 @@ public interface QuerydslPredicateExecutor<T> {
* Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. In case no
* match could be found an empty {@link Iterable} is returned.
*
* @param predicate can be {@literal null}.
* @param predicate must not be {@literal null}.
* @param orders the {@link OrderSpecifier}s to sort the results by.
* @return all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s.
*/
@ -85,8 +87,8 @@ public interface QuerydslPredicateExecutor<T> { @@ -85,8 +87,8 @@ public interface QuerydslPredicateExecutor<T> {
* Returns a {@link Page} of entities matching the given {@link Predicate}. In case no match could be found, an empty
* {@link Page} is returned.
*
* @param predicate can be {@literal null}.
* @param pageable must not be {@literal null}.
* @param predicate must not be {@literal null}.
* @param pageable may be {@link Pageable#unpaged()}, must not be {@literal null}.
* @return a {@link Page} of entities matching the given {@link Predicate}.
*/
Page<T> findAll(Predicate predicate, Pageable pageable);
@ -94,7 +96,7 @@ public interface QuerydslPredicateExecutor<T> { @@ -94,7 +96,7 @@ public interface QuerydslPredicateExecutor<T> {
/**
* Returns the number of instances matching the given {@link Predicate}.
*
* @param predicate the {@link Predicate} to count instances for, can be {@literal null}.
* @param predicate the {@link Predicate} to count instances for, must not be {@literal null}.
* @return the number of instances matching the {@link Predicate}.
*/
long count(Predicate predicate);
@ -102,7 +104,7 @@ public interface QuerydslPredicateExecutor<T> { @@ -102,7 +104,7 @@ public interface QuerydslPredicateExecutor<T> {
/**
* Checks whether the data store contains elements that match the given {@link Predicate}.
*
* @param predicate the {@link Predicate} to use for the existence check, can be {@literal null}.
* @param predicate the {@link Predicate} to use for the existence check, must not be {@literal null}.
* @return {@literal true} if the data store contains elements that match the given {@link Predicate}.
*/
boolean exists(Predicate predicate);

Loading…
Cancel
Save