- All Implemented Interfaces:
Reactable,Refreshable
- Author:
- Julien Henry
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe side of the diff to which the comment applies. -
Field Summary
Fields inherited from class org.kohsuke.github.GHIssueComment
authorAssociation, body, bodyHtml, bodyText, htmlUrl, userFields inherited from class org.kohsuke.github.GHObject
responseHeaderFields -
Constructor Summary
ConstructorsConstructorDescriptionCreate default GHPullRequestReviewComment instance -
Method Summary
Modifier and TypeMethodDescriptioncreateReaction(ReactionContent content) Creates the reaction.voiddelete()Deletes this review comment.voiddeleteReaction(GHReaction reaction) Delete reaction.protected StringGets api route.protected StringgetApiRoute(boolean includePullNumber) Gets api route.Gets commit id.Gets diff hunk.longGets in reply to id.intgetLine()Gets The line of the blob to which the comment applies.Gets commit id.intGets The line of the blob to which the comment applies.intGets original position.intGets The first line of the range for a multi-line comment.Gets the pull request to which this review comment is associated.getPath()Gets path.intGets position.Gets The ID of the pull request review to which the comment belongs.Gets URL for the pull request that the review comment belongs to.Gets the Reaction RollupgetSide()Gets The side of the diff to which the comment applies.intGets The first line of the range for a multi-line comment.Gets The side of the first line of the range for a multi-line comment.getUser()Gets the user who posted this comment.List reactions.voidrefresh()Refreshes this comment by fetching the full data from the API.Create a new comment that replies to this comment.voidUpdates the comment.Methods inherited from class org.kohsuke.github.GHIssueComment
getAuthorAssociation, getBody, getBodyHtml, getBodyText, getHtmlUrlMethods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kohsuke.github.Refreshable
refresh
-
Constructor Details
-
GHPullRequestReviewComment
public GHPullRequestReviewComment()Create default GHPullRequestReviewComment instance
-
-
Method Details
-
createReaction
Creates the reaction.- Specified by:
createReactionin interfaceReactable- Overrides:
createReactionin classGHIssueComment- Parameters:
content- the content- Returns:
- the GH reaction
- Throws:
IOException- Signals that an I/O exception has occurred.
-
delete
Deletes this review comment.- Overrides:
deletein classGHIssueComment- Throws:
IOException- the io exception
-
deleteReaction
Delete reaction.- Specified by:
deleteReactionin interfaceReactable- Overrides:
deleteReactionin classGHIssueComment- Parameters:
reaction- the reaction- Throws:
IOException- Signals that an I/O exception has occurred.
-
getCommitId
Gets commit id.- Returns:
- the commit id
-
getDiffHunk
Gets diff hunk.- Returns:
- the diff hunk
-
getInReplyToId
public long getInReplyToId()Gets in reply to id.- Returns:
- the in reply to id, or -1 if not a reply
-
getLine
public int getLine()Gets The line of the blob to which the comment applies. The last line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
- the line to which the comment applies, or -1 if not available
-
getOriginalCommitId
Gets commit id.- Returns:
- the commit id
-
getOriginalLine
public int getOriginalLine()Gets The line of the blob to which the comment applies. The last line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
- the line to which the comment applies, or -1 if not available
-
getOriginalPosition
public int getOriginalPosition()Gets original position.- Returns:
- the original position
-
getOriginalStartLine
public int getOriginalStartLine()Gets The first line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
- the original start line, or -1 if not available or not a multi-line comment
-
getParent
Gets the pull request to which this review comment is associated.- Overrides:
getParentin classGHIssueComment- Returns:
- the parent pull request
-
getPath
Gets path.- Returns:
- the path
-
getPosition
public int getPosition()Gets position.- Returns:
- the position, or -1 if not available
-
getPullRequestReviewId
Gets The ID of the pull request review to which the comment belongs.- Returns:
Longthe ID of the pull request review
-
getPullRequestUrl
Gets URL for the pull request that the review comment belongs to.- Returns:
URLthe URL of the pull request
-
getReactions
Gets the Reaction Rollup- Returns:
GHPullRequestReviewCommentReactionsthe reaction rollup
-
getSide
Gets The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
GHPullRequestReviewComment.Sidethe side of the diff to which the comment applies, orGHPullRequestReviewComment.Side.UNKNOWNif not available
-
getStartLine
public int getStartLine()Gets The first line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
- the start line, or -1 if not available or not a multi-line comment
-
getStartSide
Gets The side of the first line of the range for a multi-line comment.This field is not available on
GHPullRequestReview.ReviewCommentobjects returned byGHPullRequestReview.listReviewComments(). UseGHPullRequestReview.ReviewComment.readPullRequestReviewComment()orGHPullRequest.listReviewComments()to obtain this value.- Returns:
GHPullRequestReviewComment.Sidethe side of the first line, orGHPullRequestReviewComment.Side.UNKNOWNif not available
-
getUser
Gets the user who posted this comment.- Overrides:
getUserin classGHIssueComment- Returns:
- the user
- Throws:
IOException- the io exception
-
listReactions
List reactions.- Specified by:
listReactionsin interfaceReactable- Overrides:
listReactionsin classGHIssueComment- Returns:
- the paged iterable
-
refresh
Refreshes this comment by fetching the full data from the API.This is useful when the comment was obtained via
GHPullRequestReview.listReviewComments(), which uses a GitHub API endpoint that does not return all fields. After calling this method, fields likegetLine(),getOriginalLine(),getSide(), etc. will return their actual values.- Specified by:
refreshin interfaceRefreshable- Throws:
IOException- if an I/O error occurs- See Also:
-
reply
Create a new comment that replies to this comment.- Parameters:
body- the body- Returns:
- the gh pull request review comment
- Throws:
IOException- the io exception
-
update
Updates the comment.- Overrides:
updatein classGHIssueComment- Parameters:
body- the body- Throws:
IOException- the io exception
-
getApiRoute
Gets api route.- Returns:
- the api route
-
getApiRoute
Gets api route.- Parameters:
includePullNumber- if true, includes the owning pull request's number in the route.- Returns:
- the api route
-