Class ItemSearchResult<T>
java.lang.Object
de.hybris.platform.integrationservices.search.ItemSearchResult<T>
Result of searching items in the platform. This result is immutable except it does not guarantee immutability
of the items returned by
getItems() method.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ItemSearchResult<T>createFrom(SearchResult<T> result) Creates new item search result instance from the specified Flexible Search result.static <T> ItemSearchResult<T>createWith(List<T> items) Creates new item search result instance when total count of matching items is not needed.static <T> ItemSearchResult<T>createWith(List<T> items, int totalCount) Creates new item search result instance with total number of matching items existing in the platform.getItems()Retrieves items existing in the platform and matching the request conditions.Retrieves total number of items existing in the platform and matching theItemSearchRequestconditions.<R> ItemSearchResult<R>Transforms this result into a result containing different kind of items.
-
Method Details
-
createFrom
Creates new item search result instance from the specified Flexible Search result.- Type Parameters:
T- type of the items searched.- Parameters:
result- flexible search result.- Returns:
- new item search result instance.
-
createWith
Creates new item search result instance with total number of matching items existing in the platform.- Type Parameters:
T- type of the items searched.- Parameters:
items- items found. Usually in this scenario this is a subset of all items existing in the platform, which match theItemSearchRequest.totalCount- total number of items persisted in the platform, which match the criteria specified by theItemSearchRequest- Returns:
- new item search result instance.
- See Also:
-
createWith
Creates new item search result instance when total count of matching items is not needed.- Type Parameters:
T- type of the items searched- Parameters:
items- items found- Returns:
- new item search result instance.
-
getItems
Retrieves items existing in the platform and matching the request conditions.- Returns:
- all items matching the
ItemSearchRequestconditions or a subset of all items in case of a paged request. When no items match the conditions, an empty list is returned.
-
getTotalCount
Retrieves total number of items existing in the platform and matching theItemSearchRequestconditions.- Returns:
- number of items matching the conditions in the platform. This number may be greater than the number of items returned
by
getItems()method whenPaginationParameterswere used in the request. If count was not requested, thenOptional.empty()is returned.
-
map
Transforms this result into a result containing different kind of items.- Type Parameters:
R- type of the entries in the transformed result- Parameters:
f- a function to be applied to each item contained in this result- Returns:
- a result containing entries, which were transformed from the original result by applying the specified function.
-