Class ResultsAggregators

java.lang.Object
com.atlassian.crowd.search.util.ResultsAggregators

public class ResultsAggregators extends Object
Utility class providing factory methods returning ResultsAggregator.
  • Constructor Details

    • ResultsAggregators

      public ResultsAggregators()
  • Method Details

    • with

      public static <T, K extends Comparable<? super K>> ResultsAggregator<T> with(Function<? super T,? extends K> maker, Query<? extends T> query)
      Creates an instance that will use the provided function to uniquely identify results and that will expect as many total results as indicated by the query.
      Parameters:
      maker - a key-making function
      query - an indication of how many results are required
    • with

      public static <T, K extends Comparable<? super K>> ResultsAggregator<T> with(Function<? super T,? extends K> maker, int startIndex, int maxResults)
    • with

      public static <T, K extends Comparable<? super K>> ResultsAggregator<T> with(Function<? super T,? extends K> maker, int startIndex, int maxResults, boolean merge)
    • forUsers

      public static <T extends User> ResultsAggregator<T> forUsers(int startIndex, int maxResults)
      Creates an aggregator that will identify and sort users by lower-cased name.
      Parameters:
      startIndex - defines how many results should be skipped
      maxResults - maximum number of results to be returned
    • with

      public static <T> ResultsAggregator<T> with(Query<T> query)
      Creates an instance that will sort, de-duplicate and constrain results according to the query.
    • with

      public static <T> ResultsAggregator<T> with(Query<T> query, boolean merge)
    • constrainResults

      public static <T> List<T> constrainResults(Query<T> query, Collection<T> values)