Interface ItemSearchService
- All Known Implementing Classes:
DefaultItemSearchService,ValidatingItemSearchService
public interface ItemSearchService
A service for searching items in the platform.
-
Method Summary
Modifier and TypeMethodDescriptionintcountItems(@NotNull ItemSearchRequest request) Counts how many items in the platform match the provided request conditions.@NotNull ItemSearchResult<ItemModel>findItems(@NotNull ItemSearchRequest request) Searches forItems in the platform based on the provided request criteria.findUniqueItem(@NotNull ItemSearchRequest request) Searches for a singleItemmatching therequestcriteria.
-
Method Details
-
findUniqueItem
Searches for a singleItemmatching therequestcriteria.- Parameters:
request- item search request- Returns:
- an Optional containing the matching item model or an empty Optional, if a matching item is not found.
- Throws:
NonUniqueItemFoundException- if more than one matching item found for the request criteria.
-
findItems
@NotNull @NotNull ItemSearchResult<ItemModel> findItems(@NotNull @NotNull ItemSearchRequest request) Searches forItems in the platform based on the provided request criteria.- Parameters:
request- a request containing search conditions, i.e. type of items to find, pagination parameters, etc- Returns:
- result of the item search.
-
countItems
Counts how many items in the platform match the provided request conditions.- Parameters:
request- a request specifying the search criteria.- Returns:
- number of items in the platform matching the search criteria.
-