Class SearchResultImpl<E>
java.lang.Object
de.hybris.platform.servicelayer.search.impl.SearchResultImpl<E>
- All Implemented Interfaces:
SearchResult<E>
Implementation of the servicelayer SearchResult interface.
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResultImpl(List<E> result, int totalCount, int requestedCount, int requestedStart) Default constructor.SearchResultImpl(List<E> result, int totalCount, int requestedCount, int requestedStart, String dataSourceId) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionintgetCount()Gets size of result collection.Gets the id of used datasource.intGets requested result count.intGets requested start index.Gets the search result.intGets size of collection without using range.booleanvoidsetFromCache(boolean fromCache)
-
Constructor Details
-
SearchResultImpl
Default constructor.- Parameters:
result- the result list from the jalo searchtotalCount- the overall count (all elements) of the jalo searchrequestedCount- the requested count (how many elements should be in the list?)requestedStart- the start count (this list should start at this element)
-
SearchResultImpl
public SearchResultImpl(List<E> result, int totalCount, int requestedCount, int requestedStart, String dataSourceId) Default constructor.- Parameters:
result- the result list from the jalo searchtotalCount- the overall count (all elements) of the jalo searchrequestedCount- the requested count (how many elements should be in the list?)requestedStart- the start count (this list should start at this element)dataSourceId- the id of used dataSource
-
-
Method Details
-
getCount
public int getCount()Description copied from interface:SearchResultGets size of result collection. Same asSearchResult.getRequestedCount()or less (if less elements are found)- Specified by:
getCountin interfaceSearchResult<E>
-
getRequestedCount
public int getRequestedCount()Description copied from interface:SearchResultGets requested result count. Same value as set inAbstractQuery.setCount(int)- Specified by:
getRequestedCountin interfaceSearchResult<E>
-
getRequestedStart
public int getRequestedStart()Description copied from interface:SearchResultGets requested start index. Same value as set inAbstractQuery.setStart(int)- Specified by:
getRequestedStartin interfaceSearchResult<E>
-
getResult
Description copied from interface:SearchResultGets the search result. Returned collection uses lazy translation approach, on first access on an collection element the element will be translated to an model. In case the entity was removed between gathering of search result and translation of specific element the returned collection will have anullvalue at this position.- Specified by:
getResultin interfaceSearchResult<E>
-
getTotalCount
public int getTotalCount()Description copied from interface:SearchResultGets size of collection without using range. Attention: WhenAbstractQuery.isNeedTotal()=false(default) than this total count is the same asSearchResult.getRequestedCount()or less. It is not the total count of all elements in the db. (only when isNeedTotal=true)- Specified by:
getTotalCountin interfaceSearchResult<E>
-
isFromCache
public boolean isFromCache() -
setFromCache
public void setFromCache(boolean fromCache) -
getDataSourceId
Description copied from interface:SearchResultGets the id of used datasource.- Specified by:
getDataSourceIdin interfaceSearchResult<E>
-