Class CompletionHandler

java.lang.Object
no.digipost.concurrent.CompletionHandler

public final class CompletionHandler extends Object
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.