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 classImmutableComment.BuilderBuilds instances of typeImmutableComment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringbody()The contents of the comment.static ImmutableComment.Builderbuilder()Creates a builder forImmutableComment.Optional<String>commitId()Commit sha this comment relates tostatic ImmutableCommentcopyOf(Comment instance)Creates an immutable copy of aCommentvalue.GitHubInstantcreatedAt()Created datebooleanequals(Object another)This instance is equal to all instances ofImmutableCommentthat have equal attribute values.inthashCode()Computes a hash code from attributes:createdAt,updatedAt,url,htmlUrl,id,user,position,line,path,commitId,body,issueUrl.URIhtmlUrl()Comment URL.Longid()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.StringtoString()Prints the immutable valueCommentwith attribute values.GitHubInstantupdatedAt()Updated dateURIurl()Comment API URL.Useruser()TheUserthat made the comment.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 present value for the optionalcommitIdattribute.ImmutableCommentwithCommitId(Optional<String> optional)Copy the current immutable object by setting an optional value for thecommitIdattribute.ImmutableCommentwithCreatedAt(GitHubInstant value)Copy the current immutable object by setting a value for thecreatedAtattribute.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.ImmutableCommentwithIssueUrl(URI value)Copy the current immutable object by setting a present value for the optionalissueUrlattribute.ImmutableCommentwithIssueUrl(Optional<? extends URI> optional)Copy the current immutable object by setting an optional value for theissueUrlattribute.ImmutableCommentwithLine(int value)Deprecated.ImmutableCommentwithLine(Optional<Integer> optional)Deprecated.ImmutableCommentwithPath(String value)Copy the current immutable object by setting a present value for the optionalpathattribute.ImmutableCommentwithPath(Optional<String> optional)Copy the current immutable object by setting an optional value for thepathattribute.ImmutableCommentwithPosition(int value)Copy the current immutable object by setting a present value for the optionalpositionattribute.ImmutableCommentwithPosition(Optional<Integer> optional)Copy the current immutable object by setting an optional value for thepositionattribute.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
-
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 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
-
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
-
withId
public final ImmutableComment withId(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- 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
-
withPosition
public final ImmutableComment withPosition(int value)
Copy the current immutable object by setting a present value for the optionalpositionattribute.- Parameters:
value- The value for position- Returns:
- A modified copy of
thisobject
-
withPosition
public final ImmutableComment withPosition(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for thepositionattribute. 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
thisobject
-
withLine
@Deprecated public final ImmutableComment withLine(int value)
Deprecated.Copy the current immutable object by setting a present value for the optionallineattribute.- Parameters:
value- The value for line- Returns:
- A modified copy of
thisobject
-
withLine
@Deprecated public final ImmutableComment withLine(Optional<Integer> optional)
Deprecated.Copy the current immutable object by setting an optional value for thelineattribute. 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
thisobject
-
withPath
public final ImmutableComment withPath(String value)
Copy the current immutable object by setting a present value for the optionalpathattribute.- Parameters:
value- The value for path- Returns:
- A modified copy of
thisobject
-
withPath
public final ImmutableComment withPath(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepathattribute. 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
thisobject
-
withCommitId
public final ImmutableComment withCommitId(String value)
Copy the current immutable object by setting a present value for the optionalcommitIdattribute.- Parameters:
value- The value for commitId- Returns:
- A modified copy of
thisobject
-
withCommitId
public final ImmutableComment withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitIdattribute. 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
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
-
withIssueUrl
public final ImmutableComment withIssueUrl(URI value)
Copy the current immutable object by setting a present value for the optionalissueUrlattribute.- Parameters:
value- The value for issueUrl- Returns:
- A modified copy of
thisobject
-
withIssueUrl
public final ImmutableComment withIssueUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theissueUrlattribute. 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
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,htmlUrl,id,user,position,line,path,commitId,body,issueUrl.
-
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.htmlUrl(java.net.URI | null) // nullablehtmlUrl.id(Long) // 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
-
-