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 or
CompletableFuture
s than can present a promise to the list of them
This builder has a strict contract on size whereby if the expectedSize is five, then there MUST be five elements presented to it.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(CompletableFuture<T> completableFuture) This adds aCompletableFuture
into the collection of resultsvoid
This adds a new value which can be either a materialized value or aCompletableFuture
await()
This will return aCompletableFuture<List<T>>
even if the inputs are all materialized valuesThis will return aCompletableFuture<List<T>>
if ANY of the input values are async otherwise it just return a materialisedList<T>
-
Method Details
-
add
This adds aCompletableFuture
into the collection of results- Parameters:
completableFuture
- the CF to add
-
addObject
This adds a new value which can be either a materialized value or aCompletableFuture
- Parameters:
object
- the object to add
-
await
CompletableFuture<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
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
-