Interface TextResult

All Superinterfaces:
Result
All Known Implementing Classes:
StringTextResult

public interface TextResult extends Result
A text result is result type which has been produced by a Job and is processed by actions.
By convention, it always implies the flavor TEXT.
Not all ResultAction can handle each FileResult, result flavors define the kind of information/data a FileResult represents and actions will handle only results they support. A result can be processed by more than one ResultAction.
Since:
taskplanner 3.0
  • Method Details

    • getText

      String getText() throws IOException
      Returns the content of the result in form of a String. The actual interpretation of the content depends on the type as returned by getTextContentType().
      Returns:
      the content as String
      Throws:
      IOException - thrown if the content is created on demand and the creation failed
      Since:
      taskplanner 3.0
    • getTextContent

      InputStream getTextContent() throws IOException
      Returns the content of the result in form of an InputStream with encoding StandardCharsets.UTF_8. The actual interpretation of the content depends on the type as returned by getTextContentType().
      Returns:
      the content as String
      Throws:
      IOException - thrown if the content is created on demand and the creation failed
      Since:
      taskplanner 3.0
    • getTextContentType

      String getTextContentType() throws Exception
      Get the MIME type this result has.
      Returns:
      the content type of this result. When null, 'text/plain' is to be used.
      Throws:
      Exception - if the type is could not be determined due to an IO problem
      Since:
      taskplanner 3.0
    • getFlavors

      default List<ResultFlavor> getFlavors()
      Defined the types of data this Result contains.
      Specified by:
      getFlavors in interface Result
      Returns:
      the ResultFlavor of this Result.