Package com.spotify.github.v3.prs
Class ImmutableComment.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutableComment.Builder
-
- Enclosing class:
- ImmutableComment
@NotThreadSafe public static final class ImmutableComment.Builder extends Object
Builds instances of typeImmutableComment. 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 ImmutableComment.Builderbody(String body)Initializes the value for thebodyattribute.ImmutableCommentbuild()Builds a newImmutableComment.ImmutableComment.BuildercommitId(String commitId)Initializes the value for thecommitIdattribute.ImmutableComment.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableComment.BuilderdiffHunk(String diffHunk)Initializes the value for thediffHunkattribute.ImmutableComment.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutableComment.Builderfrom(Comment instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.prs.Commentinstance.ImmutableComment.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableComment.Builderid(Long id)Initializes the value for theidattribute.ImmutableComment.Builderlinks(CommentLinks links)Initializes the value for thelinksattribute.ImmutableComment.BuilderoriginalCommitId(String originalCommitId)Initializes the value for theoriginalCommitIdattribute.ImmutableComment.BuilderoriginalPosition(Integer originalPosition)Initializes the value for theoriginalPositionattribute.ImmutableComment.Builderpath(String path)Initializes the value for thepathattribute.ImmutableComment.Builderposition(Integer position)Initializes the value for thepositionattribute.ImmutableComment.BuilderpullRequestUrl(URI pullRequestUrl)Initializes the value for thepullRequestUrlattribute.ImmutableComment.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.ImmutableComment.Builderurl(URI url)Initializes the value for theurlattribute.ImmutableComment.Builderuser(User user)Initializes the value for theuserattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableComment.Builder from(Comment instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.prs.Commentinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableComment.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 ImmutableComment.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 ImmutableComment.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
-
url
@CanIgnoreReturnValue public final ImmutableComment.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
-
id
@CanIgnoreReturnValue public final ImmutableComment.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
-
diffHunk
@CanIgnoreReturnValue public final ImmutableComment.Builder diffHunk(@Nullable String diffHunk)
Initializes the value for thediffHunkattribute.- Parameters:
diffHunk- The value for diffHunk (can benull)- Returns:
thisbuilder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableComment.Builder path(@Nullable String path)
Initializes the value for thepathattribute.- Parameters:
path- The value for path (can benull)- Returns:
thisbuilder for use in a chained invocation
-
position
@CanIgnoreReturnValue public final ImmutableComment.Builder position(@Nullable Integer position)
Initializes the value for thepositionattribute.- Parameters:
position- The value for position (can benull)- Returns:
thisbuilder for use in a chained invocation
-
originalPosition
@CanIgnoreReturnValue public final ImmutableComment.Builder originalPosition(@Nullable Integer originalPosition)
Initializes the value for theoriginalPositionattribute.- Parameters:
originalPosition- The value for originalPosition (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableComment.Builder commitId(@Nullable String commitId)
Initializes the value for thecommitIdattribute.- Parameters:
commitId- The value for commitId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
originalCommitId
@CanIgnoreReturnValue public final ImmutableComment.Builder originalCommitId(@Nullable String originalCommitId)
Initializes the value for theoriginalCommitIdattribute.- Parameters:
originalCommitId- The value for originalCommitId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutableComment.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
-
body
@CanIgnoreReturnValue public final ImmutableComment.Builder body(@Nullable String body)
Initializes the value for thebodyattribute.- Parameters:
body- The value for body (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableComment.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
-
pullRequestUrl
@CanIgnoreReturnValue public final ImmutableComment.Builder pullRequestUrl(@Nullable URI pullRequestUrl)
Initializes the value for thepullRequestUrlattribute.- Parameters:
pullRequestUrl- The value for pullRequestUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutableComment.Builder links(@Nullable CommentLinks links)
Initializes the value for thelinksattribute.- Parameters:
links- The value for links (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableComment build()
Builds a newImmutableComment.- Returns:
- An immutable instance of Comment
- Throws:
IllegalStateException- if any required attributes are missing
-
-