Class LocalHandlerResult
java.lang.Object
io.fluxzero.sdk.tracking.handling.LocalHandlerResult
Result of trying to handle a message locally.
This type preserves a synchronously returned handler value as a direct value instead of wrapping it immediately
in a CompletableFuture. It also distinguishes a handler that returned null from a message for which
no local handler was found.
-
Method Summary
Modifier and TypeMethodDescriptionasFuture()static LocalHandlerResultasynchronous(CompletableFuture<?> future) static LocalHandlerResultCreates a successfully completed local result.static LocalHandlerResultgetValue()booleanbooleanstatic LocalHandlerResultReturns the shared result for a message that had no matching local handler.
-
Method Details
-
notHandled
Returns the shared result for a message that had no matching local handler.- Returns:
- a not-handled result
-
completed
Creates a successfully completed local result. The value itself may benull.- Parameters:
value- the value returned by the handler- Returns:
- a synchronously completed result
-
asynchronous
-
failed
-
isHandled
public boolean isHandled() -
isCompletedSuccessfully
public boolean isCompletedSuccessfully() -
getValue
-
asFuture
-