Package graphql.execution
Interface Async.CombinedBuilder<T>
-
- Type Parameters:
T
- for two
- Enclosing class:
- Async
public static interface Async.CombinedBuilder<T>
A builder of materialized objects orCompletableFuture
s than can present a promise to the list of themThis builder has a strict contract on size whereby if the expectedSize is five, then there MUST be five elements presented to it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(java.util.concurrent.CompletableFuture<T> completableFuture)
This adds aCompletableFuture
into the collection of resultsvoid
addObject(java.lang.Object object)
This adds a new value which can be either a materialized value or aCompletableFuture
java.util.concurrent.CompletableFuture<java.util.List<T>>
await()
This will return aCompletableFuture<List<T>>
even if the inputs are all materialized valuesjava.lang.Object
awaitPolymorphic()
This will return aCompletableFuture<List<T>>
if ANY of the input values are async otherwise it just return a materialisedList<T>
-
-
-
Method Detail
-
add
void add(java.util.concurrent.CompletableFuture<T> completableFuture)
This adds aCompletableFuture
into the collection of results- Parameters:
completableFuture
- the CF to add
-
addObject
void addObject(java.lang.Object object)
This adds a new value which can be either a materialized value or aCompletableFuture
- Parameters:
object
- the object to add
-
await
java.util.concurrent.CompletableFuture<java.util.List<T>> await()
This will return aCompletableFuture<List<T>>
even if the inputs are all materialized values- Returns:
- a CompletableFuture to a List of values
-
awaitPolymorphic
java.lang.Object awaitPolymorphic()
This will return aCompletableFuture<List<T>>
if ANY of the input values are async otherwise it just return a materialisedList<T>
- Returns:
- either a CompletableFuture or a materialized list
-
-