Class Task.Builder
java.lang.Object
co.yellowdog.platform.model.builders.ValidatedBuilder<Task>
co.yellowdog.platform.model.Task.Builder
- Enclosing class:
Task
A builder that can be used to build a new Task that is automatically validated on build.
-
Method Summary
Modifier and TypeMethodDescriptionarguments
(@NonNull Collection<? extends String> arguments) Builds the object without enforcing validation constraints.environment
(String environmentKey, String environmentValue) environment
(Map<? extends String, ? extends String> environment) flattenInputPaths
(FlattenPath flattenInputPaths) inputFromNamespace
(String namespace, String objectNamePattern) Specifies that matching objects from the supplied namespace should be downloaded to the working directory prior to task execution.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.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.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.inputs
(Collection<? extends TaskInput> inputs) output
(TaskOutput output) outputFromDirectory
(String directoryName, String filePattern) Specifies that matching files from the directory (defined in the agent configuration with the specified name) should be uploaded.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.Specifies that the text file containing the output from the task execution process should be uploaded.outputFromWorkerDirectory
(String filePattern) Specifies that matching files from the working directory of the worker that executed the task should be uploaded.outputFromWorkerDirectory
(String filePattern, boolean required) Specifies that matching files from the working directory of the worker that executed the task should be uploaded.outputs
(Collection<? extends TaskOutput> outputs) toString()
Methods inherited from class co.yellowdog.platform.model.builders.ValidatedBuilder
build, validate
-
Method Details
-
argument
-
arguments
-
arguments
-
clearArguments
-
inputFromTaskNamespace
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 nameverification
- indicates if input verification is required- Returns:
- the builder
-
inputFromNamespace
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 objectsobjectNamePattern
- 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 objectsobjectNamePattern
- an ant-style pattern to select objects by nameverification
- indicates if input verification is required- Returns:
- the builder
-
outputFromWorkerDirectory
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
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 directoryrequired
- indicates if at least one matching file is required- Returns:
- the builder
-
outputFromDirectory
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 filesfilePattern
- an ant-style pattern to select files by path relative to the working directory- Returns:
- the builder
-
outputFromDirectory
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 filesfilePattern
- an ant-style pattern to select files by path relative to the working directoryrequired
- indicates if at least one matching file is required- Returns:
- the builder
-
outputFromTaskProcess
Specifies that the text file containing the output from the task execution process should be uploaded.- Returns:
- the builder
-
name
- Parameters:
name
- the task name- Returns:
this
.
-
tag
- Parameters:
tag
- the task tag- Returns:
this
.
-
taskType
- Parameters:
taskType
- the task type- Returns:
this
.
-
taskData
- Parameters:
taskData
- the task initialisation data- Returns:
this
.
-
environment
-
environment
-
clearEnvironment
-
input
-
inputs
-
clearInputs
-
flattenInputPaths
- Parameters:
flattenInputPaths
- how input paths should be flattened- Returns:
this
.
-
output
-
outputs
-
clearOutputs
-
timeout
- Parameters:
timeout
- the task timeout- Returns:
this
.
-
data
- Returns:
this
.
-
buildUnchecked
Description copied from class:ValidatedBuilder
Builds the object without enforcing validation constraints. This should only be used for testing purposes- Overrides:
buildUnchecked
in classValidatedBuilder<Task>
- Returns:
- the object being built
-
toString
-