Class SearchResultImpl<E>
- java.lang.Object
-
- de.hybris.platform.servicelayer.search.impl.SearchResultImpl<E>
-
- All Implemented Interfaces:
SearchResult<E>
public class SearchResultImpl<E> extends java.lang.Object implements SearchResult<E>
Implementation of the servicelayer SearchResult interface.
-
-
Constructor Summary
Constructors Constructor Description SearchResultImpl(java.util.List<E> result, int totalCount, int requestedCount, int requestedStart)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount()Gets size of result collection.intgetRequestedCount()Gets requested result count.intgetRequestedStart()Gets requested start index.java.util.List<E>getResult()Gets the search result.intgetTotalCount()Gets size of collection without using range.booleanisFromCache()voidsetFromCache(boolean fromCache)
-
-
-
Constructor Detail
-
SearchResultImpl
public SearchResultImpl(java.util.List<E> result, int totalCount, int requestedCount, int requestedStart)
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)
-
-
Method Detail
-
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
public java.util.List<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)
-
-