Class SearchResults<T>

java.lang.Object
com.atlassian.jira.issue.search.SearchResults<T>
All Implemented Interfaces:
Pager

@PublicApi public class SearchResults<T> extends Object implements Pager
  • Constructor Details

    • SearchResults

      public SearchResults(List<T> resultsInPage, int totalResultCount, int maxResultCount, int startIndex)
      Construct searchResults using the resultsInPage that should be displayed, and the 'total' number of results. This is used when we do a stable search and want to return a max of the selected page's length, not the stable search limit.
      Parameters:
      resultsInPage - A list of SearchResults objects
      totalResultCount - The count of the number of resultsInPage returned
      maxResultCount - The maximum number of resultsInPage to include in the search
      startIndex - The index of the first result in the search
  • Method Details

    • transform

      public <R> SearchResults<R> transform(Function<T,R> transformer)
    • getResults

      public List<T> getResults()
      Get the resultsInPage available in this page.
      Returns:
      A list of SearchResults objects
    • getStart

      public int getStart()
      Specified by:
      getStart in interface Pager
    • getEnd

      public int getEnd()
      Specified by:
      getEnd in interface Pager
    • getTotal

      public int getTotal()
      Specified by:
      getTotal in interface Pager
    • getMax

      public int getMax()
    • getNextStart

      public int getNextStart()
      Specified by:
      getNextStart in interface Pager
    • getPreviousStart

      public int getPreviousStart()
      Specified by:
      getPreviousStart in interface Pager
    • getNiceStart

      public int getNiceStart()
      Return the 'readable' start (ie 1 instead of 0)
    • getPages

      public List<com.atlassian.jira.issue.search.SearchResults.Page> getPages()
      Specified by:
      getPages in interface Pager