Package com.spotify.github.v3.comment
Class ImmutableComment
- java.lang.Object
-
- com.spotify.github.v3.comment.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 Deprecated Methods Modifier and Type Method Description String
body()
The contents of the comment.static ImmutableComment.Builder
builder()
Creates a builder forImmutableComment
.Optional<String>
commitId()
Commit sha this comment relates tostatic ImmutableComment
copyOf(Comment instance)
Creates an immutable copy of aComment
value.GitHubInstant
createdAt()
Created dateboolean
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
,htmlUrl
,id
,user
,position
,line
,path
,commitId
,body
,issueUrl
.URI
htmlUrl()
Comment URL.int
id()
Comment ID.Optional<URI>
issueUrl()
The issueURL which the comment belongs to.Optional<Integer>
line()
Deprecated.Useposition()
insteadOptional<String>
path()
Relative path of the file to comment on.Optional<Integer>
position()
Line index in the diff to comment on.String
toString()
Prints the immutable valueComment
with attribute values.GitHubInstant
updatedAt()
Updated dateURI
url()
Comment API URL.User
user()
TheUser
that made the comment.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 present value for the optionalcommitId
attribute.ImmutableComment
withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitId
attribute.ImmutableComment
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableComment
withHtmlUrl(URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableComment
withId(int value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableComment
withIssueUrl(URI value)
Copy the current immutable object by setting a present value for the optionalissueUrl
attribute.ImmutableComment
withIssueUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theissueUrl
attribute.ImmutableComment
withLine(int value)
Deprecated.ImmutableComment
withLine(Optional<Integer> optional)
Deprecated.ImmutableComment
withPath(String value)
Copy the current immutable object by setting a present value for the optionalpath
attribute.ImmutableComment
withPath(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepath
attribute.ImmutableComment
withPosition(int value)
Copy the current immutable object by setting a present value for the optionalposition
attribute.ImmutableComment
withPosition(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theposition
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
-
line
@Deprecated public Optional<Integer> line()
Deprecated.Useposition()
insteadLine number in the file to comment on.
-
body
@Nullable public String body()
The contents of the comment.
-
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
-
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
-
withId
public final ImmutableComment withId(int value)
Copy the current immutable object by setting a value for theid
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id- 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
-
withPosition
public final ImmutableComment withPosition(int value)
Copy the current immutable object by setting a present value for the optionalposition
attribute.- Parameters:
value
- The value for position- Returns:
- A modified copy of
this
object
-
withPosition
public final ImmutableComment withPosition(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theposition
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for position- Returns:
- A modified copy of
this
object
-
withLine
@Deprecated public final ImmutableComment withLine(int value)
Deprecated.Copy the current immutable object by setting a present value for the optionalline
attribute.- Parameters:
value
- The value for line- Returns:
- A modified copy of
this
object
-
withLine
@Deprecated public final ImmutableComment withLine(Optional<Integer> optional)
Deprecated.Copy the current immutable object by setting an optional value for theline
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for line- Returns:
- A modified copy of
this
object
-
withPath
public final ImmutableComment withPath(String value)
Copy the current immutable object by setting a present value for the optionalpath
attribute.- Parameters:
value
- The value for path- Returns:
- A modified copy of
this
object
-
withPath
public final ImmutableComment withPath(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepath
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for path- Returns:
- A modified copy of
this
object
-
withCommitId
public final ImmutableComment withCommitId(String value)
Copy the current immutable object by setting a present value for the optionalcommitId
attribute.- Parameters:
value
- The value for commitId- Returns:
- A modified copy of
this
object
-
withCommitId
public final ImmutableComment withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitId
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for commitId- Returns:
- A modified copy of
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
-
withIssueUrl
public final ImmutableComment withIssueUrl(URI value)
Copy the current immutable object by setting a present value for the optionalissueUrl
attribute.- Parameters:
value
- The value for issueUrl- Returns:
- A modified copy of
this
object
-
withIssueUrl
public final ImmutableComment withIssueUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theissueUrl
attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for issueUrl- Returns:
- A modified copy of
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
,htmlUrl
,id
,user
,position
,line
,path
,commitId
,body
,issueUrl
.
-
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
.htmlUrl(java.net.URI | null) // nullablehtmlUrl
.id(int) // requiredid
.user(com.spotify.github.v3.User | null) // nullableuser
.position(Integer) // optionalposition
.line(Integer) // optionalline
.path(String) // optionalpath
.commitId(String) // optionalcommitId
.body(String | null) // nullablebody
.issueUrl(java.net.URI) // optionalissueUrl
.build();- Returns:
- A new ImmutableComment builder
-
-