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 total number of results matched by the search
      maxResultCount - The maximum number of results in the page
      startIndex - The index of the first result in the search
    • SearchResults

      public SearchResults(List<T> resultsInPage, int totalResultCount, int maxResultCount, int startIndex, Integer maxResultWindow)
      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 total number of results matched by the search
      maxResultCount - The maximum number of results in the page
      startIndex - The index of the first result in the search
      maxResultWindow - The maximum number of results that can be retrieved from the underlying search engine, or null if unlimited
  • 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()
      The total number of results matched by the search. The maximum number of results that can be retrieved is limited by the maxResultWindow value.
      Specified by:
      getTotal in interface Pager
    • getMax

      public int getMax()
      The maximum number of issues to retrieve in a single page.
    • getMaxResultWindow

      public Integer getMaxResultWindow()
      Returns:
      the maximum number of results that can be retrieved from the underlying search engine, or null if unlimited
    • 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