Skip to content

Commit

Permalink
Complement javadoc
Browse files Browse the repository at this point in the history
Consequently resolve javadocJar task warnings
  • Loading branch information
jsajlovic committed Dec 1, 2021
1 parent 6740465 commit 4d7ede9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

/**
* Projection that will be applied to query. Prefer using result class but if result class is not needed this can be used as an alternative.
* @param <R>
*
* @param <R> search request
*/
@RequiredArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ public interface SortablePageableRequest {

/**
* Page number.
*
* @return page number
*/
Integer getPageNumber();

/**
* Number of elements to fetch.
*
* @return number of elements
*/
Integer getPageSize();

/**
* List of properties to sort by.
*
* @return list of properties
*/
List<SortProperty> getSortPropertyList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,69 @@ public interface SearchExecutor<T> {
/**
* Returns a single entity that matches conditions applied from search request or {@link Optional#empty()} if none was found.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @param <R> type of request
* @param <P> projection class
* @return a single entity matching conditions or {@link Optional#empty()} if none was found.
* @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the query returns more than one
* result.
* result.
*/
<R, P> Optional<P> findOne(R request, SearchConfiguration<T, P, R> searchConfiguration);

/**
* Returns all entities matching conditions applied from search request.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @param <R> type of request
* @param <P> projection class
* @return all entities matching the given conditions applied from search request
*/
<R, P> List<P> findAll(R request, SearchConfiguration<T, P, R> searchConfiguration);

/**
* Returns all entities matching conditions applied from search request sorted by sort parameter.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @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, must not be {@literal null}.
* @param <R> type of request
* @param <P> projection class
* @return all entities matching the given conditions applied from search request
*/
<R, P> List<P> findAll(R request, SearchConfiguration<T, P, R> searchConfiguration, Sort sort);

/**
* Returns a {@link Page} of entities matching conditions applied from search request. In case no match could be found, an empty {@link Page} is returned.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @param pageable can be {@literal null}.
* @param pageable can be {@literal null}.
* @param <R> type of request
* @param <P> projection class
* @return a {@link Page} of entities matching the given conditions applied from search request
*/
<R, P> Page<P> findAll(R request, SearchConfiguration<T, P, R> searchConfiguration, Pageable pageable);

/**
* Returns the number of instances matching conditions applied from search request.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @param <R> type of request
* @param <P> projection class
* @return the number of instances matching conditions applied from search request.
*/
<R, P> long count(R request, SearchConfiguration<T, P, R> searchConfiguration);

/**
* Whether the data store contains elements matching conditions applied from search request.
*
* @param request search request that contains query values
* @param request search request that contains query values
* @param searchConfiguration configuration that decides how query should be built
* @param <R> type of request
* @param <P> projection class
* @return {@literal true} if the data store contains elements matching conditions applied from search request.
*/
<R, P> boolean exists(R request, SearchConfiguration<T, P, R> searchConfiguration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ public interface StringSearchExecutor<T> {
/**
* Returns a single entity that matches conditions applied from search term and property to search list or {@link Optional#empty()} if none was found.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param searchConfiguration configuration that decides how query should be built
* @param <P> projection class
* @return a single entity matching conditions or {@link Optional#empty()} if none was found.
* @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the query returns more than one
*/
Expand All @@ -25,51 +26,56 @@ public interface StringSearchExecutor<T> {
/**
* Returns all entities matching conditions applied from search term and property to search list.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param searchConfiguration configuration that decides how query should be built
* @param <P> projection class
* @return all entities matching the given conditions applied from search term and property to search list
*/
<P> List<P> findAll(String searchTerm, List<String> propertyToSearchList, SearchConfiguration<T, P, Map<String, Object>> searchConfiguration);

/**
* Returns all entities matching conditions applied from search term and property to search list sorted by sort parameter.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param searchConfiguration configuration that decides how query should be built
* @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}.
* @param <P> projection class
* @return all entities matching the given conditions applied from search term and property to search list
*/
<P> List<P> findAll(String searchTerm, List<String> propertyToSearchList, SearchConfiguration<T, P, Map<String, Object>> searchConfiguration, Sort sort);

/**
* Returns a {@link Page} of entities matching conditions applied from search term and property to search list. In case no match could be found, an empty {@link Page} is returned.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param pageable can be {@literal null}.
* @param searchConfiguration configuration that decides how query should be built
* @param pageable can be {@literal null}.
* @param <P> projection class
* @return a {@link Page} of entities matching the given conditions applied from search term and property to search list
*/
<P> Page<P> findAll(String searchTerm, List<String> propertyToSearchList, SearchConfiguration<T, P, Map<String, Object>> searchConfiguration, Pageable pageable);

/**
* Returns the number of instances matching conditions applied from search term and property to search list.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param searchConfiguration configuration that decides how query should be built
* @param <P> projection class
* @return the number of instances matching conditions applied from search term and property to search list.
*/
<P> long count(String searchTerm, List<String> propertyToSearchList, SearchConfiguration<T, P, Map<String, Object>> searchConfiguration);

/**
* Whether the data store contains elements matching conditions applied from search term and property to search list.
*
* @param searchTerm search term to search
* @param searchTerm search term to search
* @param propertyToSearchList properties to search
* @param searchConfiguration configuration that decides how query should be built
* @param searchConfiguration configuration that decides how query should be built
* @param <P> projection class
* @return {@literal true} if the data store contains elements matching conditions applied from search term and property to search list.
*/
<P> boolean exists(String searchTerm, List<String> propertyToSearchList, SearchConfiguration<T, P, Map<String, Object>> searchConfiguration);
Expand Down

0 comments on commit 4d7ede9

Please sign in to comment.