Class Task.Builder

Enclosing class:
Task

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

    • argument

      public Task.Builder argument(String argument)
    • arguments

      public Task.Builder arguments(@NonNull @NonNull Collection<? extends String> arguments)
    • arguments

      public Task.Builder arguments(String... arguments)
    • clearArguments

      public Task.Builder clearArguments()
    • inputFromTaskNamespace

      public Task.Builder inputFromTaskNamespace(String objectNamePattern)
      Specifies that matching objects from the same namespace as the task should be downloaded to the working directory prior to task execution.
      Parameters:
      objectNamePattern - an ant-style pattern to select objects by name
      Returns:
      the builder
    • inputFromTaskNamespace

      public Task.Builder inputFromTaskNamespace(String objectNamePattern, TaskInputVerification verification)
      Specifies that matching objects from the same namespace as the task should be downloaded to the working directory prior to task execution.
      Parameters:
      objectNamePattern - an ant-style pattern to select objects by name
      verification - indicates if input verification is required
      Returns:
      the builder
    • inputFromNamespace

      public Task.Builder inputFromNamespace(String namespace, String objectNamePattern)
      Specifies that matching objects from the supplied namespace should be downloaded to the working directory prior to task execution.
      Parameters:
      namespace - the namespace containing matching objects
      objectNamePattern - an ant-style pattern to select objects by name
      Returns:
      the builder
    • inputFromNamespace

      public Task.Builder inputFromNamespace(String namespace, String objectNamePattern, TaskInputVerification verification)
      Specifies that matching objects from the supplied namespace should be downloaded to the working directory prior to task execution.
      Parameters:
      namespace - the namespace containing matching objects
      objectNamePattern - an ant-style pattern to select objects by name
      verification - indicates if input verification is required
      Returns:
      the builder
    • outputFromWorkerDirectory

      public Task.Builder outputFromWorkerDirectory(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
    • outputFromWorkerDirectory

      public Task.Builder outputFromWorkerDirectory(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
    • outputFromDirectory

      public Task.Builder outputFromDirectory(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
    • outputFromDirectory

      public Task.Builder outputFromDirectory(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
    • outputFromTaskProcess

      public Task.Builder outputFromTaskProcess()
      Specifies that the text file containing the output from the task execution process should be uploaded.
      Returns:
      the builder
    • name

      public Task.Builder name(String name)
      Parameters:
      name - the task name
      Returns:
      this.
    • tag

      public Task.Builder tag(String tag)
      Parameters:
      tag - the task tag
      Returns:
      this.
    • taskType

      public Task.Builder taskType(String taskType)
      Parameters:
      taskType - the task type
      Returns:
      this.
    • taskData

      public Task.Builder taskData(String taskData)
      Parameters:
      taskData - the task initialisation data
      Returns:
      this.
    • environment

      public Task.Builder environment(String environmentKey, String environmentValue)
    • environment

      public Task.Builder environment(Map<? extends String,? extends String> environment)
    • clearEnvironment

      public Task.Builder clearEnvironment()
    • input

      public Task.Builder input(TaskInput input)
    • inputs

      public Task.Builder inputs(Collection<? extends TaskInput> inputs)
    • clearInputs

      public Task.Builder clearInputs()
    • flattenInputPaths

      public Task.Builder flattenInputPaths(FlattenPath flattenInputPaths)
      Parameters:
      flattenInputPaths - how input paths should be flattened
      Returns:
      this.
    • output

      public Task.Builder output(TaskOutput output)
    • outputs

      public Task.Builder outputs(Collection<? extends TaskOutput> outputs)
    • clearOutputs

      public Task.Builder clearOutputs()
    • timeout

      public Task.Builder timeout(Duration timeout)
      Parameters:
      timeout - the task timeout
      Returns:
      this.
    • data

      public Task.Builder data(TaskData data)
      Returns:
      this.
    • buildUnchecked

      public Task 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<Task>
      Returns:
      the object being built
    • toString

      public String toString()
      Overrides:
      toString in class Object