Class LocalHandlerResult

java.lang.Object
io.fluxzero.sdk.tracking.handling.LocalHandlerResult

public final class LocalHandlerResult extends Object
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 Details

    • notHandled

      public static LocalHandlerResult notHandled()
      Returns the shared result for a message that had no matching local handler.
      Returns:
      a not-handled result
    • completed

      public static LocalHandlerResult completed(Object value)
      Creates a successfully completed local result. The value itself may be null.
      Parameters:
      value - the value returned by the handler
      Returns:
      a synchronously completed result
    • asynchronous

      public static LocalHandlerResult asynchronous(CompletableFuture<?> future)
    • failed

      public static LocalHandlerResult failed(Throwable error)
    • isHandled

      public boolean isHandled()
    • isCompletedSuccessfully

      public boolean isCompletedSuccessfully()
    • getValue

      public Object getValue()
    • asFuture

      public CompletableFuture<Object> asFuture()