Package org.praxislive.ide.core.api
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
An extension of Task that produces a result when it completes
successfully.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.praxislive.ide.core.api.Task
Task.State, Task.WithResult<T> -
Field Summary
Fields inherited from interface org.praxislive.ide.core.api.Task
PROP_STATE -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletionStage<T> compute(Task.WithResult<T> task) Execute the task wrapped in a completion stage of the result.result()Access the result.Methods inherited from interface org.openide.util.Cancellable
cancelMethods inherited from interface org.praxislive.ide.core.api.Task
addPropertyChangeListener, description, execute, getState, log, removePropertyChangeListener
-
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
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
-