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