Module io.helidon.common.reactive
Package io.helidon.common.reactive
Interface OptionalCompletionStage<T>
- Type Parameters:
T
- return type of the asynchronous operation
- All Superinterfaces:
CompletionStage<Optional<T>>
A completion stage that allows processing of cases when the element
is present and when not.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> OptionalCompletionStage
<T> create
(CompletionStage<Optional<T>> originalStage) Creates a new instance of the completion stage that allows processing of cases when the element is present and when not.Returns a newOptionalCompletionStage
that, when this stage completes normally and returnsnull
, executes the given action.Returns a newOptionalCompletionStage
that, when this stage completes normally and returns non-null
, is executed with this stage's result as the argument to the supplied action.Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Method Details
-
onEmpty
Returns a newOptionalCompletionStage
that, when this stage completes normally and returnsnull
, executes the given action.- Parameters:
action
- the action to perform before completing the returnedOptionalCompletionStage
- Returns:
- the new
OptionalCompletionStage
-
onValue
Returns a newOptionalCompletionStage
that, when this stage completes normally and returns non-null
, is executed with this stage's result as the argument to the supplied action.- Parameters:
action
- the action to perform before completing the returnedOptionalCompletionStage
- Returns:
- the new
OptionalCompletionStage
-
create
Creates a new instance of the completion stage that allows processing of cases when the element is present and when not.- Type Parameters:
T
- return type of the asynchronous operation- Parameters:
originalStage
- source completion stage instance- Returns:
- the new
OptionalCompletionStage
-