Interface DataResult

All Superinterfaces:
RenderableResult
All Known Implementing Classes:
DataResultBase, DataResultCsv, DataResultJson, DataResultText

public interface DataResult extends RenderableResult
Represents the result of a CLI tool.
  • Method Details

    • setMessage

      DataResult setMessage(String message)
      Parameters:
      message - the "main" result message.
    • setExitCode

      DataResult setExitCode(ExitCode exitCode)
      Parameters:
      exitCode - indicates whether operation was successful or had any errors.
    • setException

      DataResult setException(Throwable t)
      Parameters:
      t - the exception in case one happened.
    • addField

      DataResult addField(String name, Object value)
      Adds a data field to the result. This can be any data "produced" by the tool, e.g. an ID generated by the tool, etc.
      Parameters:
      name - name of the field.
      value - the value of the field.
    • getFields

      Map<String,String> getFields()
      Returns:
      the fields in the result for testability
    • getMessage

      String getMessage()
      Returns:
      the message for testability