Interface Task.WithResult<T>

Type Parameters:
T - result type
All Superinterfaces:
org.openide.util.Cancellable, Task
All Known Implementing Classes:
AbstractTask.WithResult
Enclosing interface:
Task

public static interface Task.WithResult<T> extends Task
An extension of Task that produces a result when it completes successfully.
  • Method Details

    • result

      T result()
      Access the result. This method should only be called when the task is in a completed state. The result in other states is undefined.
      Returns:
      completed task result
    • compute

      static <T> CompletionStage<T> compute(Task.WithResult<T> task)
      Execute the task wrapped in a completion stage of the result.
      Type Parameters:
      T - task result type
      Parameters:
      task - task with result
      Returns:
      task completion stage