Class TaskOutput.Builder

Enclosing class:
TaskOutput

public static class TaskOutput.Builder extends ValidatedBuilder<TaskOutput>
A builder that can be used to build a new TaskOutput that is automatically validated on build.
  • Method Details

    • fromWorkerDirectory

      public TaskOutput.Builder fromWorkerDirectory(String filePattern)
      Specifies that matching files from the working directory of the worker that executed the task should be uploaded.
      Parameters:
      filePattern - an ant-style pattern to select files by path relative to the working directory
      Returns:
      the builder
    • fromWorkerDirectory

      public TaskOutput.Builder fromWorkerDirectory(String filePattern, boolean required)
      Specifies that matching files from the working directory of the worker that executed the task should be uploaded.
      Parameters:
      filePattern - an ant-style pattern to select files by path relative to the working directory
      required - indicates if at least one matching file is required
      Returns:
      the builder
    • fromDirectory

      public TaskOutput.Builder fromDirectory(String directoryName, String filePattern)
      Specifies that matching files from the directory (defined in the agent configuration with the specified name) should be uploaded.
      Parameters:
      directoryName - the pre-configured name of the directory from which to upload files
      filePattern - an ant-style pattern to select files by path relative to the working directory
      Returns:
      the builder
    • fromDirectory

      public TaskOutput.Builder fromDirectory(String directoryName, String filePattern, boolean required)
      Specifies that matching files from the directory (defined in the agent configuration with the specified name) should be uploaded.
      Parameters:
      directoryName - the pre-configured name of the directory from which to upload files
      filePattern - an ant-style pattern to select files by path relative to the working directory
      required - indicates if at least one matching file is required
      Returns:
      the builder
    • fromTaskProcess

      public TaskOutput.Builder fromTaskProcess()
      Specifies that the text file containing the output from the task execution process should be uploaded.
      Returns:
      the builder
    • source

      public TaskOutput.Builder source(TaskOutputSource source)
      The source context where the outputs can be found.
      Parameters:
      source - the source context where the outputs can be found
      Returns:
      this.
    • directoryName

      public TaskOutput.Builder directoryName(String directoryName)
      The pre-configured directory name; only if the source is set to TaskOutputSource.OTHER_DIRECTORY.
      Parameters:
      directoryName - the pre-configured directory name
      Returns:
      this.
    • filePattern

      public TaskOutput.Builder filePattern(String filePattern)
      An ant-style pattern to select output files by path.
      Parameters:
      filePattern - an ant-style pattern to select output files by path
      Returns:
      this.
    • alwaysUpload

      public TaskOutput.Builder alwaysUpload(boolean alwaysUpload)
      Indicates that the outputs should still be uploaded even if the task execution failed or was aborted.
      Parameters:
      alwaysUpload - indicates that the outputs should still be uploaded even if the task execution failed or was aborted
      Returns:
      this.
    • required

      public TaskOutput.Builder required(boolean required)
      Indicates that at least one output should be found otherwise the task execution is failed.
      Parameters:
      required - at least one output is required
      Returns:
      this.
    • buildUnchecked

      public TaskOutput buildUnchecked()
      Description copied from class: ValidatedBuilder
      Builds the object without enforcing validation constraints. This should only be used for testing purposes
      Overrides:
      buildUnchecked in class ValidatedBuilder<TaskOutput>
      Returns:
      the object being built
    • toString

      public String toString()
      Overrides:
      toString in class Object