Package com.spotify.github.v3.prs
Class ImmutableComment
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutableComment
-
- All Implemented Interfaces:
UpdateTracking,Comment
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableComment extends Object implements Comment
Immutable implementation ofComment.Use the builder to create immutable instances:
ImmutableComment.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableComment.BuilderBuilds instances of typeImmutableComment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbody()The text of the comment.static ImmutableComment.Builderbuilder()Creates a builder forImmutableComment.StringcommitId()The SHA of the commit to comment on.static ImmutableCommentcopyOf(Comment instance)Creates an immutable copy of aCommentvalue.GitHubInstantcreatedAt()Created dateStringdiffHunk()Unified diff.booleanequals(Object another)This instance is equal to all instances ofImmutableCommentthat have equal attribute values.inthashCode()Computes a hash code from attributes:createdAt,updatedAt,url,id,diffHunk,path,position,originalPosition,commitId,originalCommitId,user,body,htmlUrl,pullRequestUrl,links.URIhtmlUrl()Comment URL.Longid()Comment id.CommentLinkslinks()Link references.StringoriginalCommitId()Base commit sha.IntegeroriginalPosition()Base content line position.Stringpath()The relative path of the file to comment on.Integerposition()The line index in the diff to comment on.URIpullRequestUrl()Pull request API URL.StringtoString()Prints the immutable valueCommentwith attribute values.GitHubInstantupdatedAt()Updated dateURIurl()Comment API URL.Useruser()Comment author.ImmutableCommentwithBody(String value)Copy the current immutable object by setting a value for thebodyattribute.ImmutableCommentwithCommitId(String value)Copy the current immutable object by setting a value for thecommitIdattribute.ImmutableCommentwithCreatedAt(GitHubInstant value)Copy the current immutable object by setting a value for thecreatedAtattribute.ImmutableCommentwithDiffHunk(String value)Copy the current immutable object by setting a value for thediffHunkattribute.ImmutableCommentwithHtmlUrl(URI value)Copy the current immutable object by setting a value for thehtmlUrlattribute.ImmutableCommentwithId(Long value)Copy the current immutable object by setting a value for theidattribute.ImmutableCommentwithLinks(CommentLinks value)Copy the current immutable object by setting a value for thelinksattribute.ImmutableCommentwithOriginalCommitId(String value)Copy the current immutable object by setting a value for theoriginalCommitIdattribute.ImmutableCommentwithOriginalPosition(Integer value)Copy the current immutable object by setting a value for theoriginalPositionattribute.ImmutableCommentwithPath(String value)Copy the current immutable object by setting a value for thepathattribute.ImmutableCommentwithPosition(Integer value)Copy the current immutable object by setting a value for thepositionattribute.ImmutableCommentwithPullRequestUrl(URI value)Copy the current immutable object by setting a value for thepullRequestUrlattribute.ImmutableCommentwithUpdatedAt(GitHubInstant value)Copy the current immutable object by setting a value for theupdatedAtattribute.ImmutableCommentwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.ImmutableCommentwithUser(User value)Copy the current immutable object by setting a value for theuserattribute.
-
-
-
Method Detail
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAtin interfaceUpdateTracking- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAtin interfaceUpdateTracking- Returns:
- The date when the issue was updated
-
diffHunk
@Nullable public String diffHunk()
Unified diff.
-
path
@Nullable public String path()
The relative path of the file to comment on.
-
position
@Nullable public Integer position()
The line index in the diff to comment on.
-
originalPosition
@Nullable public Integer originalPosition()
Base content line position.- Specified by:
originalPositionin interfaceComment
-
commitId
@Nullable public String commitId()
The SHA of the commit to comment on.
-
originalCommitId
@Nullable public String originalCommitId()
Base commit sha.- Specified by:
originalCommitIdin interfaceComment
-
body
@Nullable public String body()
The text of the comment.
-
pullRequestUrl
@Nullable public URI pullRequestUrl()
Pull request API URL.- Specified by:
pullRequestUrlin interfaceComment
-
links
@Nullable public CommentLinks links()
Link references.
-
withCreatedAt
public final ImmutableComment withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAtattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for createdAt (can benull)- Returns:
- A modified copy of the
thisobject
-
withUpdatedAt
public final ImmutableComment withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAtattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for updatedAt (can benull)- Returns:
- A modified copy of the
thisobject
-
withUrl
public final ImmutableComment withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
withId
public final ImmutableComment withId(@Nullable Long value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withDiffHunk
public final ImmutableComment withDiffHunk(@Nullable String value)
Copy the current immutable object by setting a value for thediffHunkattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for diffHunk (can benull)- Returns:
- A modified copy of the
thisobject
-
withPath
public final ImmutableComment withPath(@Nullable String value)
Copy the current immutable object by setting a value for thepathattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for path (can benull)- Returns:
- A modified copy of the
thisobject
-
withPosition
public final ImmutableComment withPosition(@Nullable Integer value)
Copy the current immutable object by setting a value for thepositionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for position (can benull)- Returns:
- A modified copy of the
thisobject
-
withOriginalPosition
public final ImmutableComment withOriginalPosition(@Nullable Integer value)
Copy the current immutable object by setting a value for theoriginalPositionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for originalPosition (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommitId
public final ImmutableComment withCommitId(@Nullable String value)
Copy the current immutable object by setting a value for thecommitIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commitId (can benull)- Returns:
- A modified copy of the
thisobject
-
withOriginalCommitId
public final ImmutableComment withOriginalCommitId(@Nullable String value)
Copy the current immutable object by setting a value for theoriginalCommitIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for originalCommitId (can benull)- Returns:
- A modified copy of the
thisobject
-
withUser
public final ImmutableComment withUser(@Nullable User value)
Copy the current immutable object by setting a value for theuserattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for user (can benull)- Returns:
- A modified copy of the
thisobject
-
withBody
public final ImmutableComment withBody(@Nullable String value)
Copy the current immutable object by setting a value for thebodyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for body (can benull)- Returns:
- A modified copy of the
thisobject
-
withHtmlUrl
public final ImmutableComment withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for htmlUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withPullRequestUrl
public final ImmutableComment withPullRequestUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thepullRequestUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pullRequestUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withLinks
public final ImmutableComment withLinks(@Nullable CommentLinks value)
Copy the current immutable object by setting a value for thelinksattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for links (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCommentthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:createdAt,updatedAt,url,id,diffHunk,path,position,originalPosition,commitId,originalCommitId,user,body,htmlUrl,pullRequestUrl,links.
-
toString
public String toString()
Prints the immutable valueCommentwith attribute values.
-
copyOf
public static ImmutableComment copyOf(Comment instance)
Creates an immutable copy of aCommentvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Comment instance
-
builder
public static ImmutableComment.Builder builder()
Creates a builder forImmutableComment.ImmutableComment.builder() .createdAt(com.spotify.github.GitHubInstant | null) // nullablecreatedAt.updatedAt(com.spotify.github.GitHubInstant | null) // nullableupdatedAt.url(java.net.URI | null) // nullableurl.id(Long | null) // nullableid.diffHunk(String | null) // nullablediffHunk.path(String | null) // nullablepath.position(Integer | null) // nullableposition.originalPosition(Integer | null) // nullableoriginalPosition.commitId(String | null) // nullablecommitId.originalCommitId(String | null) // nullableoriginalCommitId.user(com.spotify.github.v3.User | null) // nullableuser.body(String | null) // nullablebody.htmlUrl(java.net.URI | null) // nullablehtmlUrl.pullRequestUrl(java.net.URI | null) // nullablepullRequestUrl.links(com.spotify.github.v3.prs.CommentLinks | null) // nullablelinks.build();- Returns:
- A new ImmutableComment builder
-
-