@PublicApi public class TaskResultBuilder extends Object
TaskTypes to produce a TaskResult| Modifier and Type | Method and Description |
|---|---|
TaskResult |
build() |
TaskResultBuilder |
checkInterceptorMatches(@NotNull ContentMatchingInterceptor interceptor,
int maximumAge) |
TaskResultBuilder |
checkInterceptorNotMatches(@NotNull ContentMatchingInterceptor interceptor,
int maximumAge) |
TaskResultBuilder |
checkReturnCode(@NotNull com.atlassian.utils.process.ExternalProcess externalProcess)
Checks that the return code of the
ExternalProcess was zero
Will only check return codes if the build state has not been set to Failed for some other reason. |
TaskResultBuilder |
checkReturnCode(@NotNull com.atlassian.utils.process.ExternalProcess externalProcess,
int expectedReturnCode)
Checks that the return code of the
ExternalProcess was of the expected type. |
TaskResultBuilder |
checkTestFailures()
Checks whether any test failures have been recorded against the buildResult and updates the state accordingly
Will only check tests if the build state has not been set to Failed for some other reason.
|
static TaskResult |
copyWithNewState(@NotNull TaskResult taskResult,
@NotNull TaskState newTaskState)
Copies a taskResult and changes the state
|
static TaskResultBuilder |
create(@NotNull TaskContext taskContext)
Deprecated.
since 5.0 use
newBuilder(CommonTaskContext) |
static TaskResult |
createFailedWithErrorResult(TaskIdentifier taskIdentifier)
Method to create error result bypassing the builder.
|
TaskResultBuilder |
failed()
Sets the Task Result Status as
TaskState.FAILED |
TaskResultBuilder |
failedWithError()
Sets the Task Result Status as
TaskState.ERROR |
TaskState |
getTaskState() |
static TaskResultBuilder |
newBuilder(@NotNull CommonTaskContext taskContext)
Creates a new TaskResultBuilder for a
CommonTaskContext |
TaskResultBuilder |
setState(TaskState taskState) |
TaskResultBuilder |
stopJobExecutionAfterTask()
stop job execution after this task result processing
|
TaskResultBuilder |
success()
Sets the Task Result Status as
TaskState.SUCCESS |
public static TaskResultBuilder newBuilder(@NotNull @NotNull CommonTaskContext taskContext)
CommonTaskContexttaskContext - of the executing TaskType@Deprecated public static TaskResultBuilder create(@NotNull @NotNull TaskContext taskContext)
newBuilder(CommonTaskContext)CommonTaskContexttaskContext - of the executing TaskTypepublic static TaskResult copyWithNewState(@NotNull @NotNull TaskResult taskResult, @NotNull @NotNull TaskState newTaskState)
taskResult - to copynewTaskState - to replace the old taskStatepublic static TaskResult createFailedWithErrorResult(TaskIdentifier taskIdentifier)
taskIdentifier - identifying the task that failedpublic TaskResultBuilder success()
TaskState.SUCCESSpublic TaskResultBuilder failed()
TaskState.FAILEDpublic TaskResultBuilder failedWithError()
TaskState.ERRORpublic TaskResultBuilder checkReturnCode(@NotNull @NotNull com.atlassian.utils.process.ExternalProcess externalProcess)
ExternalProcess was zero
Will only check return codes if the build state has not been set to Failed for some other reason.externalProcess - - to check return code ofpublic TaskResultBuilder checkReturnCode(@NotNull @NotNull com.atlassian.utils.process.ExternalProcess externalProcess, int expectedReturnCode)
ExternalProcess was of the expected type.
Will only check return codes if the build state has not been set to Failed for some other reason.externalProcess - - process to check return code fromexpectedReturnCode- - the return code to be considered a success.public TaskResultBuilder checkTestFailures()
public TaskResultBuilder checkInterceptorMatches(@NotNull @NotNull ContentMatchingInterceptor interceptor, int maximumAge)
public TaskResultBuilder checkInterceptorNotMatches(@NotNull @NotNull ContentMatchingInterceptor interceptor, int maximumAge)
public TaskResult build()
public TaskState getTaskState()
public TaskResultBuilder setState(TaskState taskState)
public TaskResultBuilder stopJobExecutionAfterTask()
Copyright © 2024 Atlassian Software Systems Pty Ltd. All rights reserved.