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 Type
    Method
    Description
    void
    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 boolean
    Checks whether the given flavor is supported by this result.
    default boolean
    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 ResultFlavor values of this result
      Since:
      taskplanner 3.0
    • supportsFlavor

      default boolean supportsFlavor(ResultFlavor flavor)
      Checks whether the given flavor is supported by this result.
      Parameters:
      flavor - the flavor to check
      Returns:
      true if this result supports the flavor; otherwise false
      Since:
      taskplanner 3.0
    • supportsOneFlavorOf

      default boolean supportsOneFlavorOf(List<ResultFlavor> flavors)
      Checks whether one of the given flavors is supported.
      Parameters:
      flavors - the flavors to check
      Returns:
      true if at least one flavor matches; otherwise false
      Since:
      taskplanner 3.0
    • cleanup

      void cleanup() throws Exception
      When result handling is finished, this method is called to release resources held by the result.

      This is also called if no appropriate ResultAction handled this result.

      Throws:
      Exception - if there was an IO problem
      Since:
      taskplanner 3.0