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 class
ImmutableComment.Builder
Builds instances of typeImmutableComment
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
body()
The text of the comment.static ImmutableComment.Builder
builder()
Creates a builder forImmutableComment
.String
commitId()
The SHA of the commit to comment on.static ImmutableComment
copyOf(Comment instance)
Creates an immutable copy of aComment
value.GitHubInstant
createdAt()
Created dateString
diffHunk()
Unified diff.boolean
equals(Object another)
This instance is equal to all instances ofImmutableComment
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:createdAt
,updatedAt
,url
,id
,diffHunk
,path
,position
,originalPosition
,commitId
,originalCommitId
,user
,body
,htmlUrl
,pullRequestUrl
,links
.URI
htmlUrl()
Comment URL.Long
id()
Comment id.CommentLinks
links()
Link references.String
originalCommitId()
Base commit sha.Integer
originalPosition()
Base content line position.String
path()
The relative path of the file to comment on.Integer
position()
The line index in the diff to comment on.URI
pullRequestUrl()
Pull request API URL.String
toString()
Prints the immutable valueComment
with attribute values.GitHubInstant
updatedAt()
Updated dateURI
url()
Comment API URL.User
user()
Comment author.ImmutableComment
withBody(String value)
Copy the current immutable object by setting a value for thebody
attribute.ImmutableComment
withCommitId(String value)
Copy the current immutable object by setting a value for thecommitId
attribute.ImmutableComment
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableComment
withDiffHunk(String value)
Copy the current immutable object by setting a value for thediffHunk
attribute.ImmutableComment
withHtmlUrl(URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableComment
withId(Long value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableComment
withLinks(CommentLinks value)
Copy the current immutable object by setting a value for thelinks
attribute.ImmutableComment
withOriginalCommitId(String value)
Copy the current immutable object by setting a value for theoriginalCommitId
attribute.ImmutableComment
withOriginalPosition(Integer value)
Copy the current immutable object by setting a value for theoriginalPosition
attribute.ImmutableComment
withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute.ImmutableComment
withPosition(Integer value)
Copy the current immutable object by setting a value for theposition
attribute.ImmutableComment
withPullRequestUrl(URI value)
Copy the current immutable object by setting a value for thepullRequestUrl
attribute.ImmutableComment
withUpdatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute.ImmutableComment
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.ImmutableComment
withUser(User value)
Copy the current immutable object by setting a value for theuser
attribute.
-
-
-
Method Detail
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAt
in 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:
originalPosition
in interfaceComment
-
commitId
@Nullable public String commitId()
The SHA of the commit to comment on.
-
originalCommitId
@Nullable public String originalCommitId()
Base commit sha.- Specified by:
originalCommitId
in interfaceComment
-
body
@Nullable public String body()
The text of the comment.
-
pullRequestUrl
@Nullable public URI pullRequestUrl()
Pull request API URL.- Specified by:
pullRequestUrl
in 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 thecreatedAt
attribute. 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
this
object
-
withUpdatedAt
public final ImmutableComment withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute. 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
this
object
-
withUrl
public final ImmutableComment withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
withId
public final ImmutableComment withId(@Nullable Long value)
Copy the current immutable object by setting a value for theid
attribute. 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
this
object
-
withDiffHunk
public final ImmutableComment withDiffHunk(@Nullable String value)
Copy the current immutable object by setting a value for thediffHunk
attribute. 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
this
object
-
withPath
public final ImmutableComment withPath(@Nullable String value)
Copy the current immutable object by setting a value for thepath
attribute. 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
this
object
-
withPosition
public final ImmutableComment withPosition(@Nullable Integer value)
Copy the current immutable object by setting a value for theposition
attribute. 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
this
object
-
withOriginalPosition
public final ImmutableComment withOriginalPosition(@Nullable Integer value)
Copy the current immutable object by setting a value for theoriginalPosition
attribute. 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
this
object
-
withCommitId
public final ImmutableComment withCommitId(@Nullable String value)
Copy the current immutable object by setting a value for thecommitId
attribute. 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
this
object
-
withOriginalCommitId
public final ImmutableComment withOriginalCommitId(@Nullable String value)
Copy the current immutable object by setting a value for theoriginalCommitId
attribute. 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
this
object
-
withUser
public final ImmutableComment withUser(@Nullable User value)
Copy the current immutable object by setting a value for theuser
attribute. 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
this
object
-
withBody
public final ImmutableComment withBody(@Nullable String value)
Copy the current immutable object by setting a value for thebody
attribute. 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
this
object
-
withHtmlUrl
public final ImmutableComment withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute. 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
this
object
-
withPullRequestUrl
public final ImmutableComment withPullRequestUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thepullRequestUrl
attribute. 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
this
object
-
withLinks
public final ImmutableComment withLinks(@Nullable CommentLinks value)
Copy the current immutable object by setting a value for thelinks
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableComment
that 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 valueComment
with attribute values.
-
copyOf
public static ImmutableComment copyOf(Comment instance)
Creates an immutable copy of aComment
value. 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) // nullable
createdAt
.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
-
-