Class TaskCollectors
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.TaskCollectors
-
public final class TaskCollectors extends Object
Static helper methods to createTask.Collectors.- Since:
- 21.06
- Author:
- bo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskCollectors.CountCollector<T>ATask.Collectorthat counts the number of results are present.static classTaskCollectors.FirstOfCollector<T>ATask.Collectorto collect any (the first provided) available result.static classTaskCollectors.LastOfCollector<T>ATask.Collectorthat collects and returns the last contributed result.static classTaskCollectors.ListOfCollector<T>ATask.Collectorthat collects and returns all contributed results that are values as aList.static classTaskCollectors.SetOfCollector<T>ATask.Collectorthat collects and returns all contributed results that are values as aSet.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Task.Collector<? super T,?,Integer>count()ATask.Collectorthat counts the number of non-null results that have been made.static <T> Task.Collector<T,?,T>firstOf()ATask.Collectorthat will collect the first provided result.static <T> Task.Collector<T,?,T>lastOf()ATask.Collectorthat returns the last added result, when all results have been provided.static <T> Task.Collector<T,?,List<T>>listOf()ATask.Collectorthat returns theListof results that are values.static <T> Task.Collector<T,?,Set<T>>setOf()ATask.Collectorthat returns theSetof results that are values.
-
-
-
Method Detail
-
listOf
public static <T> Task.Collector<T,?,List<T>> listOf()
ATask.Collectorthat returns theListof results that are values.- Type Parameters:
T- the type of the result- Returns:
- a
Task.Collector
-
setOf
public static <T> Task.Collector<T,?,Set<T>> setOf()
ATask.Collectorthat returns theSetof results that are values.- Type Parameters:
T- the type of the result- Returns:
- a
Task.Collector
-
lastOf
public static <T> Task.Collector<T,?,T> lastOf()
ATask.Collectorthat returns the last added result, when all results have been provided.- Type Parameters:
T- the type of the result- Returns:
- a
Task.Collector
-
count
public static <T> Task.Collector<? super T,?,Integer> count()
ATask.Collectorthat counts the number of non-null results that have been made.- Type Parameters:
T- the type of result- Returns:
- a
Task.Collector
-
firstOf
public static <T> Task.Collector<T,?,T> firstOf()
ATask.Collectorthat will collect the first provided result.- Type Parameters:
T- the type of result- Returns:
- a
Task.Collector
-
-