Package com.atlassian.crowd.search.util
Class ResultsAggregators
java.lang.Object
com.atlassian.crowd.search.util.ResultsAggregators
Utility class providing factory methods returning
ResultsAggregator
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
constrainResults
(Query<T> query, Collection<T> values) static <T extends User>
ResultsAggregator<T>forUsers
(int startIndex, int maxResults) Creates an aggregator that will identify and sort users by lower-cased name.static <T> ResultsAggregator<T>
Creates an instance that will sort, de-duplicate and constrain results according to thequery
.static <T> ResultsAggregator<T>
static <T,
K extends Comparable<? super K>>
ResultsAggregator<T>static <T,
K extends Comparable<? super K>>
ResultsAggregator<T>static <T,
K extends Comparable<? super K>>
ResultsAggregator<T>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.
-
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 functionquery
- 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
Creates an aggregator that will identify and sort users by lower-cased name.- Parameters:
startIndex
- defines how many results should be skippedmaxResults
- maximum number of results to be returned
-
with
Creates an instance that will sort, de-duplicate and constrain results according to thequery
. -
with
-
constrainResults
-