Interface Result
- All Known Subinterfaces:
FileResult, PrintResult, TextResult
- All Known Implementing Classes:
ByteArrayFileResult, LazyInputStreamFileResult, LocalFileResult, StringTextResult
public interface Result
A result is an object produced by a
Job and processed by
actions.
Currently there are three base types: FileResult, TextResult, and PrintResult.
Not all ResultAction can handle every Result; result flavors define the kind of
information/data a Result represents and actions will handle only results they support. A result can
be processed by more than one ResultAction.
- Since:
- taskplanner 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()When result handling is finished, this method is called to release resources held by the result.@Nonnull List<ResultFlavor> Defines the types of data this result contains.default booleansupportsFlavor(ResultFlavor flavor) Checks whether the given flavor is supported by this result.default booleansupportsOneFlavorOf(List<ResultFlavor> flavors) Checks whether one of the given flavors is supported.
-
Method Details
-
getFlavors
@Nonnull List<ResultFlavor> getFlavors()Defines the types of data this result contains.- Returns:
- the
ResultFlavorvalues of this result - Since:
- taskplanner 3.0
-
supportsFlavor
Checks whether the given flavor is supported by this result.- Parameters:
flavor- the flavor to check- Returns:
trueif this result supports the flavor; otherwisefalse- Since:
- taskplanner 3.0
-
supportsOneFlavorOf
Checks whether one of the given flavors is supported.- Parameters:
flavors- the flavors to check- Returns:
trueif at least one flavor matches; otherwisefalse- Since:
- taskplanner 3.0
-
cleanup
When result handling is finished, this method is called to release resources held by the result.This is also called if no appropriate
ResultActionhandled this result.- Throws:
Exception- if there was an IO problem- Since:
- taskplanner 3.0
-