Class HelloTerminal.TaskResult

java.lang.Object
com.guinetik.examples.HelloTerminal.TaskResult
Enclosing class:
HelloTerminal

public static class HelloTerminal.TaskResult extends Object
Represents the result of an asynchronous task.
  • Constructor Details

    • TaskResult

      public TaskResult(boolean success, String message, Exception error)
      Creates a new TaskResult.
      Parameters:
      success - whether the task succeeded
      message - the result message
      error - any error that occurred
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Checks if the task was successful.
      Returns:
      true if successful, false otherwise
    • getMessage

      public String getMessage()
      Gets the result message.
      Returns:
      the message, or null if failed
    • getError

      public Optional<Exception> getError()
      Gets any error that occurred.
      Returns:
      the error, or null if successful
    • toString

      public String toString()
      Overrides:
      toString in class Object