Class TaskCollectors
java.lang.Object
com.oracle.coherence.concurrent.executor.TaskCollectors
Static helper methods to create
Task.Collector
s.- Since:
- 21.06
- Author:
- bo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
ATask.Collector
that counts the number of results are present.static class
ATask.Collector
to collect any (the first provided) available result.static class
ATask.Collector
that collects and returns the last contributed result.static class
ATask.Collector
that collects and returns all contributed results that are values as aList
.static class
ATask.Collector
that collects and returns all contributed results that are values as aSet
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 Details
-
listOf
ATask.Collector
that returns theList
of results that are values.- Type Parameters:
T
- the type of the result- Returns:
- a
Task.Collector
-
setOf
ATask.Collector
that returns theSet
of results that are values.- Type Parameters:
T
- the type of the result- Returns:
- a
Task.Collector
-
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
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
ATask.Collector
that will collect the first provided result.- Type Parameters:
T
- the type of result- Returns:
- a
Task.Collector
-