Package no.digipost.concurrent
Class CompletionHandler
java.lang.Object
no.digipost.concurrent.CompletionHandler
Convenience utility to build various handler functions which will be called with
either the first argument set to a value of any type, or
the second argument as a Throwable indicating an error. Usable for
CompletableFuture.whenComplete(BiConsumer),
CompletableFuture.handle(BiFunction), or any of their async variants.
The built handling functions will always prioritize exception instances in case it is (erroneously) invoked with both a result value and an exception.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <R> CompletionHandler.ConsumerBuilder<R>static <R> CompletionHandler.ConsumerBuilder<R>static <R,U> CompletionHandler.FunctionBuilder<R, U> static <R,U> CompletionHandler.FunctionBuilder<R, U> static <R,U> CompletionHandler.FunctionBuilder<R, U> onSuccess(U successValue)
-
Field Details
-
doNothingOnSuccess
-
-
Method Details
-
onSuccess
-
onSuccess
-
onSuccess
-
onSuccess
-
onSuccess
-