Class OrderedResultsConstrainer<T>

java.lang.Object
com.atlassian.crowd.search.util.OrderedResultsConstrainer<T>

public class OrderedResultsConstrainer<T> extends Object
Helper class constraining results according to the start index and maximum results.
  • Constructor Details

    • OrderedResultsConstrainer

      public OrderedResultsConstrainer(Predicate<T> filter, int startIndex, int maxResults)
      Parameters:
      filter - results filter, null means no filtering
      startIndex - results with index lower than startIndex will be dropped
      maxResults - maximum number of results, for all results specify EntityQuery.ALL_RESULTS
  • Method Details

    • addAll

      public void addAll(Iterable<T> collection)
      Parameters:
      collection - collection to append to results
    • toList

      public List<T> toList()
      Returns constrained results.
    • getRemainingCount

      public int getRemainingCount()
      Returns remaining number of results that need to be fetched. If EntityQuery.ALL_RESULTS were requested then returns EntityQuery.ALL_RESULTS .