Package io.jenkins.plugins.checks.api
Class ChecksDetails.ChecksDetailsBuilder
- java.lang.Object
-
- io.jenkins.plugins.checks.api.ChecksDetails.ChecksDetailsBuilder
-
- Enclosing class:
- ChecksDetails
public static class ChecksDetails.ChecksDetailsBuilder extends Object
Builder forChecksDetails
.
-
-
Constructor Summary
Constructors Constructor Description ChecksDetailsBuilder()
Construct a builder forChecksDetails
.
-
Method Summary
-
-
-
Constructor Detail
-
ChecksDetailsBuilder
public ChecksDetailsBuilder()
Construct a builder forChecksDetails
.
-
-
Method Detail
-
withName
public ChecksDetails.ChecksDetailsBuilder withName(String name)
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
public ChecksDetails.ChecksDetailsBuilder withStatus(ChecksStatus status)
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
public ChecksDetails.ChecksDetailsBuilder withDetailsURL(String detailsURL)
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
public ChecksDetails.ChecksDetailsBuilder withStartedAt(LocalDateTime startedAt)
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
public ChecksDetails.ChecksDetailsBuilder withConclusion(ChecksConclusion conclusion)
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
public ChecksDetails.ChecksDetailsBuilder withCompletedAt(LocalDateTime completedAt)
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
public ChecksDetails.ChecksDetailsBuilder withOutput(ChecksOutput output)
Set the output of a check.- Parameters:
output
- an output of a check- Returns:
- this builder
- Throws:
NullPointerException
- if theoutputs
is null
-
withActions
public ChecksDetails.ChecksDetailsBuilder withActions(List<ChecksAction> actions)
Set the actions of a check.- Parameters:
actions
- a list of actions- Returns:
- this builder
- Throws:
NullPointerException
- if theactions
is null
-
addAction
public ChecksDetails.ChecksDetailsBuilder addAction(ChecksAction action)
Adds aChecksAction
.- Parameters:
action
- the action- Returns:
- this builder
-
build
public ChecksDetails build()
Actually build theChecksDetail
.- Returns:
- the built
ChecksDetail
-
-