Package io.jenkins.plugins.checks.api
Class ChecksDetails.ChecksDetailsBuilder
java.lang.Object
io.jenkins.plugins.checks.api.ChecksDetails.ChecksDetailsBuilder
- Enclosing class:
- ChecksDetails
Builder for
ChecksDetails
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAction
(ChecksAction action) Adds aChecksAction
.build()
Actually build theChecksDetail
.withActions
(List<ChecksAction> actions) Set the actions of a check.withCompletedAt
(LocalDateTime completedAt) Set the time when a check completes.withConclusion
(ChecksConclusion conclusion) Set the conclusion of a check.withDetailsURL
(String detailsURL) Set the url of a site with full details of a check.Set the name of the check.withOutput
(ChecksOutput output) Set the output of a check.withStartedAt
(LocalDateTime startedAt) Set the time when a check starts.withStatus
(ChecksStatus status) Set the status of the check.
-
Constructor Details
-
ChecksDetailsBuilder
public ChecksDetailsBuilder()Construct a builder forChecksDetails
.
-
-
Method Details
-
withName
Set the name of the check.Note that for GitHub check runs, the name shown on GitHub UI will be the same as this attribute and GitHub uses this attribute to identify a check run, so make sure this name is unique, e.g. "Coverage".
- Parameters:
name
- the check's name- Returns:
- this builder
- Throws:
NullPointerException
- if thename
is null
-
withStatus
Set the status of the check.Note that for a GitHub check run, if the status is not set, the default "queued" will be used.
- Parameters:
status
- the check's status- Returns:
- this builder
- Throws:
NullPointerException
- if thestatus
is null
-
withDetailsURL
Set the url of a site with full details of a check.Note that for a GitHub check run, the url must use http or https scheme.
If the details url is not set, the Jenkins build url will be used, e.g. https://ci.jenkins.io/job/Core/job/jenkins/job/master/2000/.
- Parameters:
detailsURL
- the url using http or https scheme- Returns:
- this builder
- Throws:
NullPointerException
- if thedetailsURL
is null
-
withStartedAt
Set the time when a check starts.- Parameters:
startedAt
- the time when a check starts- Returns:
- this builder
- Throws:
NullPointerException
- if thestartAt
is null
-
withConclusion
Set the conclusion of a check.Note that for a GitHub check run, the conclusion should only be set when the
status
wasChecksStatus.COMPLETED
.- Parameters:
conclusion
- the conclusion- Returns:
- this builder
- Throws:
NullPointerException
- if theconclusion
is null
-
withCompletedAt
Set the time when a check completes.- Parameters:
completedAt
- the time when a check completes- Returns:
- this builder
- Throws:
NullPointerException
- if thecompletedAt
is null
-
withOutput
Set the output of a check.- Parameters:
output
- an output of a check- Returns:
- this builder
- Throws:
NullPointerException
- if theoutputs
is null
-
withActions
Set the actions of a check.- Parameters:
actions
- a list of actions- Returns:
- this builder
- Throws:
NullPointerException
- if theactions
is null
-
addAction
Adds aChecksAction
.- Parameters:
action
- the action- Returns:
- this builder
-
build
Actually build theChecksDetail
.- Returns:
- the built
ChecksDetail
-