Package com.spotify.github.v3.prs
Class ImmutablePullRequestItem.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutablePullRequestItem.Builder
-
- Enclosing class:
- ImmutablePullRequestItem
@NotThreadSafe public static final class ImmutablePullRequestItem.Builder extends Object
Builds instances of typeImmutablePullRequestItem. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutablePullRequestItem.BuilderaddAllRequestedReviewers(Iterable<? extends User> elements)Adds elements torequestedReviewerslist.ImmutablePullRequestItem.BuilderaddAllRequestedTeams(Iterable<? extends User> elements)Adds elements torequestedTeamslist.ImmutablePullRequestItem.BuilderaddRequestedReviewers(User element)Adds one element torequestedReviewerslist.ImmutablePullRequestItem.BuilderaddRequestedReviewers(User... elements)Adds elements torequestedReviewerslist.ImmutablePullRequestItem.BuilderaddRequestedTeams(User element)Adds one element torequestedTeamslist.ImmutablePullRequestItem.BuilderaddRequestedTeams(User... elements)Adds elements torequestedTeamslist.ImmutablePullRequestItem.Builderassignee(User assignee)Initializes the optional valueassigneeto assignee.ImmutablePullRequestItem.Builderassignee(Optional<? extends User> assignee)Initializes the optional valueassigneeto assignee.ImmutablePullRequestItem.Builderassignees(List<User> assignees)Initializes the optional valueassigneesto assignees.ImmutablePullRequestItem.Builderassignees(Optional<? extends List<User>> assignees)Initializes the optional valueassigneesto assignees.ImmutablePullRequestItem.Builderbase(PullRequestRef base)Initializes the value for thebaseattribute.ImmutablePullRequestItem.Builderbody(String body)Initializes the optional valuebodyto body.ImmutablePullRequestItem.Builderbody(Optional<String> body)Initializes the optional valuebodyto body.ImmutablePullRequestItembuild()Builds a newImmutablePullRequestItem.ImmutablePullRequestItem.BuilderclosedAt(GitHubInstant closedAt)Initializes the optional valueclosedAtto closedAt.ImmutablePullRequestItem.BuilderclosedAt(Optional<? extends GitHubInstant> closedAt)Initializes the optional valueclosedAtto closedAt.ImmutablePullRequestItem.BuildercommentsUrl(URI commentsUrl)Initializes the value for thecommentsUrlattribute.ImmutablePullRequestItem.BuildercommitsUrl(URI commitsUrl)Initializes the value for thecommitsUrlattribute.ImmutablePullRequestItem.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutablePullRequestItem.BuilderdiffUrl(URI diffUrl)Initializes the value for thediffUrlattribute.ImmutablePullRequestItem.Builderfrom(CloseTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.CloseTrackinginstance.ImmutablePullRequestItem.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutablePullRequestItem.Builderfrom(PullRequestItem instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.prs.PullRequestIteminstance.ImmutablePullRequestItem.Builderhead(PullRequestRef head)Initializes the value for theheadattribute.ImmutablePullRequestItem.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutablePullRequestItem.Builderid(Long id)Initializes the value for theidattribute.ImmutablePullRequestItem.BuilderissueUrl(URI issueUrl)Initializes the value for theissueUrlattribute.ImmutablePullRequestItem.Builderlinks(PullRequestLinks links)Initializes the value for thelinksattribute.ImmutablePullRequestItem.Builderlocked(Boolean locked)Initializes the value for thelockedattribute.ImmutablePullRequestItem.BuildermergeCommitSha(String mergeCommitSha)Initializes the optional valuemergeCommitShato mergeCommitSha.ImmutablePullRequestItem.BuildermergeCommitSha(Optional<String> mergeCommitSha)Initializes the optional valuemergeCommitShato mergeCommitSha.ImmutablePullRequestItem.BuildermergedAt(GitHubInstant mergedAt)Initializes the optional valuemergedAtto mergedAt.ImmutablePullRequestItem.BuildermergedAt(Optional<? extends GitHubInstant> mergedAt)Initializes the optional valuemergedAtto mergedAt.ImmutablePullRequestItem.Buildermilestone(Milestone milestone)Initializes the optional valuemilestoneto milestone.ImmutablePullRequestItem.Buildermilestone(Optional<? extends Milestone> milestone)Initializes the optional valuemilestoneto milestone.ImmutablePullRequestItem.Buildernumber(Integer number)Initializes the value for thenumberattribute.ImmutablePullRequestItem.BuilderpatchUrl(URI patchUrl)Initializes the value for thepatchUrlattribute.ImmutablePullRequestItem.BuilderrequestedReviewers(Iterable<? extends User> elements)Sets or replaces all elements forrequestedReviewerslist.ImmutablePullRequestItem.BuilderrequestedTeams(Iterable<? extends User> elements)Sets or replaces all elements forrequestedTeamslist.ImmutablePullRequestItem.BuilderreviewCommentsUrl(URI reviewCommentsUrl)Initializes the value for thereviewCommentsUrlattribute.ImmutablePullRequestItem.BuilderreviewCommentUrl(String reviewCommentUrl)Initializes the value for thereviewCommentUrlattribute.ImmutablePullRequestItem.Builderstate(String state)Initializes the value for thestateattribute.ImmutablePullRequestItem.BuilderstatusesUrl(URI statusesUrl)Initializes the value for thestatusesUrlattribute.ImmutablePullRequestItem.Buildertitle(String title)Initializes the value for thetitleattribute.ImmutablePullRequestItem.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.ImmutablePullRequestItem.Builderurl(URI url)Initializes the value for theurlattribute.ImmutablePullRequestItem.Builderuser(User user)Initializes the value for theuserattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder from(PullRequestItem instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.prs.PullRequestIteminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder from(CloseTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.CloseTrackinginstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAtattribute.- Parameters:
createdAt- The value for createdAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAtattribute.- Parameters:
updatedAt- The value for updatedAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
closedAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder closedAt(GitHubInstant closedAt)
Initializes the optional valueclosedAtto closedAt.- Parameters:
closedAt- The value for closedAt- Returns:
thisbuilder for chained invocation
-
closedAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder closedAt(Optional<? extends GitHubInstant> closedAt)
Initializes the optional valueclosedAtto closedAt.- Parameters:
closedAt- The value for closedAt- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder id(@Nullable Long id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrlattribute.- Parameters:
htmlUrl- The value for htmlUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
diffUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder diffUrl(@Nullable URI diffUrl)
Initializes the value for thediffUrlattribute.- Parameters:
diffUrl- The value for diffUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
patchUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder patchUrl(@Nullable URI patchUrl)
Initializes the value for thepatchUrlattribute.- Parameters:
patchUrl- The value for patchUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
issueUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder issueUrl(@Nullable URI issueUrl)
Initializes the value for theissueUrlattribute.- Parameters:
issueUrl- The value for issueUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commitsUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder commitsUrl(@Nullable URI commitsUrl)
Initializes the value for thecommitsUrlattribute.- Parameters:
commitsUrl- The value for commitsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
number
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder number(@Nullable Integer number)
Initializes the value for thenumberattribute.- Parameters:
number- The value for number (can benull)- Returns:
thisbuilder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder state(@Nullable String state)
Initializes the value for thestateattribute.- Parameters:
state- The value for state (can benull)- Returns:
thisbuilder for use in a chained invocation
-
title
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder title(@Nullable String title)
Initializes the value for thetitleattribute.- Parameters:
title- The value for title (can benull)- Returns:
thisbuilder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder body(String body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder body(Optional<String> body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for use in a chained invocation
-
assignee
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder assignee(User assignee)
Initializes the optional valueassigneeto assignee.- Parameters:
assignee- The value for assignee- Returns:
thisbuilder for chained invocation
-
assignee
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder assignee(Optional<? extends User> assignee)
Initializes the optional valueassigneeto assignee.- Parameters:
assignee- The value for assignee- Returns:
thisbuilder for use in a chained invocation
-
assignees
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder assignees(List<User> assignees)
Initializes the optional valueassigneesto assignees.- Parameters:
assignees- The value for assignees- Returns:
thisbuilder for chained invocation
-
assignees
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder assignees(Optional<? extends List<User>> assignees)
Initializes the optional valueassigneesto assignees.- Parameters:
assignees- The value for assignees- Returns:
thisbuilder for use in a chained invocation
-
milestone
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder milestone(Milestone milestone)
Initializes the optional valuemilestoneto milestone.- Parameters:
milestone- The value for milestone- Returns:
thisbuilder for chained invocation
-
milestone
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder milestone(Optional<? extends Milestone> milestone)
Initializes the optional valuemilestoneto milestone.- Parameters:
milestone- The value for milestone- Returns:
thisbuilder for use in a chained invocation
-
locked
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder locked(@Nullable Boolean locked)
Initializes the value for thelockedattribute.- Parameters:
locked- The value for locked (can benull)- Returns:
thisbuilder for use in a chained invocation
-
mergedAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder mergedAt(GitHubInstant mergedAt)
Initializes the optional valuemergedAtto mergedAt.- Parameters:
mergedAt- The value for mergedAt- Returns:
thisbuilder for chained invocation
-
mergedAt
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder mergedAt(Optional<? extends GitHubInstant> mergedAt)
Initializes the optional valuemergedAtto mergedAt.- Parameters:
mergedAt- The value for mergedAt- Returns:
thisbuilder for use in a chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder head(@Nullable PullRequestRef head)
Initializes the value for theheadattribute.- Parameters:
head- The value for head (can benull)- Returns:
thisbuilder for use in a chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder base(@Nullable PullRequestRef base)
Initializes the value for thebaseattribute.- Parameters:
base- The value for base (can benull)- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder user(@Nullable User user)
Initializes the value for theuserattribute.- Parameters:
user- The value for user (can benull)- Returns:
thisbuilder for use in a chained invocation
-
statusesUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder statusesUrl(@Nullable URI statusesUrl)
Initializes the value for thestatusesUrlattribute.- Parameters:
statusesUrl- The value for statusesUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
reviewCommentsUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder reviewCommentsUrl(@Nullable URI reviewCommentsUrl)
Initializes the value for thereviewCommentsUrlattribute.- Parameters:
reviewCommentsUrl- The value for reviewCommentsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
reviewCommentUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder reviewCommentUrl(@Nullable String reviewCommentUrl)
Initializes the value for thereviewCommentUrlattribute.- Parameters:
reviewCommentUrl- The value for reviewCommentUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commentsUrl
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder commentsUrl(@Nullable URI commentsUrl)
Initializes the value for thecommentsUrlattribute.- Parameters:
commentsUrl- The value for commentsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder links(@Nullable PullRequestLinks links)
Initializes the value for thelinksattribute.- Parameters:
links- The value for links (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addRequestedReviewers
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addRequestedReviewers(User element)
Adds one element torequestedReviewerslist.- Parameters:
element- A requestedReviewers element- Returns:
thisbuilder for use in a chained invocation
-
addRequestedReviewers
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addRequestedReviewers(User... elements)
Adds elements torequestedReviewerslist.- Parameters:
elements- An array of requestedReviewers elements- Returns:
thisbuilder for use in a chained invocation
-
requestedReviewers
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder requestedReviewers(@Nullable Iterable<? extends User> elements)
Sets or replaces all elements forrequestedReviewerslist.- Parameters:
elements- An iterable of requestedReviewers elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRequestedReviewers
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addAllRequestedReviewers(Iterable<? extends User> elements)
Adds elements torequestedReviewerslist.- Parameters:
elements- An iterable of requestedReviewers elements- Returns:
thisbuilder for use in a chained invocation
-
addRequestedTeams
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addRequestedTeams(User element)
Adds one element torequestedTeamslist.- Parameters:
element- A requestedTeams element- Returns:
thisbuilder for use in a chained invocation
-
addRequestedTeams
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addRequestedTeams(User... elements)
Adds elements torequestedTeamslist.- Parameters:
elements- An array of requestedTeams elements- Returns:
thisbuilder for use in a chained invocation
-
requestedTeams
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder requestedTeams(@Nullable Iterable<? extends User> elements)
Sets or replaces all elements forrequestedTeamslist.- Parameters:
elements- An iterable of requestedTeams elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRequestedTeams
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder addAllRequestedTeams(Iterable<? extends User> elements)
Adds elements torequestedTeamslist.- Parameters:
elements- An iterable of requestedTeams elements- Returns:
thisbuilder for use in a chained invocation
-
mergeCommitSha
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder mergeCommitSha(String mergeCommitSha)
Initializes the optional valuemergeCommitShato mergeCommitSha.- Parameters:
mergeCommitSha- The value for mergeCommitSha- Returns:
thisbuilder for chained invocation
-
mergeCommitSha
@CanIgnoreReturnValue public final ImmutablePullRequestItem.Builder mergeCommitSha(Optional<String> mergeCommitSha)
Initializes the optional valuemergeCommitShato mergeCommitSha.- Parameters:
mergeCommitSha- The value for mergeCommitSha- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePullRequestItem build()
Builds a newImmutablePullRequestItem.- Returns:
- An immutable instance of PullRequestItem
- Throws:
IllegalStateException- if any required attributes are missing
-
-