Package io.manebot.database.search
Class DefaultSearchResult<T>
- java.lang.Object
-
- io.manebot.database.search.DefaultSearchResult<T>
-
- All Implemented Interfaces:
SearchResult<T>
public class DefaultSearchResult<T> extends java.lang.Object implements SearchResult<T>
-
-
Constructor Summary
Constructors Constructor Description DefaultSearchResult(Search search, SearchHandler<T> handler, long totalResults, int pageSize, long page, java.util.List<T> results)
-
Method Summary
Modifier and Type Method Description SearchHandler<T>
getHandler()
Gets the search handler that build this result.long
getPage()
Gets the page number that the associated result set expresses.int
getPageSize()
Gets the maximum size of the page offered by this search result.Search
getQuery()
Gets the query associated with this search result.java.util.List<T>
getResults()
Gets the objects found on the page this search result expresses.long
getTotalResults()
Gets the count of total results found in this result.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.manebot.database.search.SearchResult
getTotalPages
-
-
-
-
Constructor Detail
-
DefaultSearchResult
public DefaultSearchResult(Search search, SearchHandler<T> handler, long totalResults, int pageSize, long page, java.util.List<T> results)
-
-
Method Detail
-
getQuery
public Search getQuery()
Description copied from interface:SearchResult
Gets the query associated with this search result.- Specified by:
getQuery
in interfaceSearchResult<T>
- Returns:
- Search query instance.
-
getHandler
public SearchHandler<T> getHandler()
Description copied from interface:SearchResult
Gets the search handler that build this result.- Specified by:
getHandler
in interfaceSearchResult<T>
- Returns:
- SearchHandler instance.
-
getTotalResults
public long getTotalResults()
Description copied from interface:SearchResult
Gets the count of total results found in this result.- Specified by:
getTotalResults
in interfaceSearchResult<T>
- Returns:
- total result count.
-
getPageSize
public int getPageSize()
Description copied from interface:SearchResult
Gets the maximum size of the page offered by this search result. This is usually the value supplied to maxResults in the SearchHandler.- Specified by:
getPageSize
in interfaceSearchResult<T>
- Returns:
- maximum page size.
-
getPage
public long getPage()
Description copied from interface:SearchResult
Gets the page number that the associated result set expresses.- Specified by:
getPage
in interfaceSearchResult<T>
- Returns:
- page number.
-
getResults
public java.util.List<T> getResults()
Description copied from interface:SearchResult
Gets the objects found on the page this search result expresses.- Specified by:
getResults
in interfaceSearchResult<T>
- Returns:
- objects found in search.
-
-