Package org.kohsuke.github
Class GHPullRequestReviewComment
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHPullRequestReviewComment
-
- All Implemented Interfaces:
Reactable
public class GHPullRequestReviewComment extends GHObject implements Reactable
Review comment to the pull request.- Author:
- Julien Henry
- See Also:
GHPullRequest#listReviewComments(),GHPullRequest#createReviewComment(String, String, String, int)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHPullRequestReviewComment.SideThe side of the diff to which the comment applies
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHPullRequestReviewComment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GHReactioncreateReaction(ReactionContent content)Creates the reaction.voiddelete()Deletes this review comment.voiddeleteReaction(GHReaction reaction)Delete reaction.static GHPullRequestReviewCommentdraft(String body, String path, int position)Deprecated.You should be usingGHPullRequestReviewBuilder.comment(String, String, int)protected StringgetApiRoute()Gets api route.protected StringgetApiRoute(boolean includePullNumber)Gets api route.GHCommentAuthorAssociationgetAuthorAssociation()Gets the author association to the project.StringgetBody()The comment itself.StringgetBodyHtml()Gets The body in html format.StringgetBodyText()Gets The body text.StringgetCommitId()Gets commit id.StringgetDiffHunk()Gets diff hunk.URLgetHtmlUrl()Gets the html url.longgetInReplyToId()Gets in reply to id.intgetLine()Gets The line of the blob to which the comment applies.StringgetOriginalCommitId()Gets commit id.intgetOriginalLine()Gets The line of the blob to which the comment applies.intgetOriginalPosition()Gets original position.intgetOriginalStartLine()Gets The first line of the range for a multi-line comment.GHPullRequestgetParent()Gets the pull request to which this review comment is associated.StringgetPath()Gets path.intgetPosition()Gets position.LonggetPullRequestReviewId()Gets The ID of the pull request review to which the comment belongs.URLgetPullRequestUrl()Gets URL for the pull request that the review comment belongs to.GHPullRequestReviewCommentReactionsgetReactions()Gets the Reaction RollupGitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.GHPullRequestReviewComment.SidegetSide()Gets The side of the diff to which the comment applies.intgetStartLine()Gets The first line of the range for a multi-line comment.GHPullRequestReviewComment.SidegetStartSide()Gets The side of the first line of the range for a multi-line comment.GHUsergetUser()Gets the user who posted this comment.PagedIterable<GHReaction>listReactions()List reactions.GHPullRequestReviewCommentreply(String body)Create a new comment that replies to this comment.voidupdate(String body)Updates the comment.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
draft
@Deprecated public static GHPullRequestReviewComment draft(String body, String path, int position)
Deprecated.You should be usingGHPullRequestReviewBuilder.comment(String, String, int)Draft gh pull request review comment.- Parameters:
body- the bodypath- the pathposition- the position- Returns:
- the gh pull request review comment
-
getParent
public GHPullRequest getParent()
Gets the pull request to which this review comment is associated.- Returns:
- the parent
-
getBody
public String getBody()
The comment itself.- Returns:
- the body
-
getUser
public GHUser getUser() throws IOException
Gets the user who posted this comment.- Returns:
- the user
- Throws:
IOException- the io exception
-
getPath
public String getPath()
Gets path.- Returns:
- the path
-
getPosition
@CheckForNull public int getPosition()
Gets position.- Returns:
- the position
-
getOriginalPosition
public int getOriginalPosition()
Gets original position.- Returns:
- the original position
-
getDiffHunk
public String getDiffHunk()
Gets diff hunk.- Returns:
- the diff hunk
-
getCommitId
public String getCommitId()
Gets commit id.- Returns:
- the commit id
-
getOriginalCommitId
public String getOriginalCommitId()
Gets commit id.- Returns:
- the commit id
-
getAuthorAssociation
public GHCommentAuthorAssociation getAuthorAssociation()
Gets the author association to the project.- Returns:
- the author association to the project
-
getInReplyToId
@CheckForNull public long getInReplyToId()
Gets in reply to id.- Returns:
- the in reply to id
-
getHtmlUrl
public URL getHtmlUrl()
Gets the html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- the html url
-
getApiRoute
protected String getApiRoute()
Gets api route.- Returns:
- the api route
-
getApiRoute
protected String getApiRoute(boolean includePullNumber)
Gets api route.- Parameters:
includePullNumber- if true, includes the owning pull request's number in the route.- Returns:
- the api route
-
getStartLine
public int getStartLine()
Gets The first line of the range for a multi-line comment.- Returns:
- the start line
-
getOriginalStartLine
public int getOriginalStartLine()
Gets The first line of the range for a multi-line comment.- Returns:
- the original start line
-
getStartSide
public GHPullRequestReviewComment.Side getStartSide()
Gets The side of the first line of the range for a multi-line comment.- Returns:
GHPullRequestReviewComment.Sidethe side of the first line
-
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.- Returns:
- the line to which the comment applies
-
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.- Returns:
- the line to which the comment applies
-
getSide
public GHPullRequestReviewComment.Side 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- Returns:
GHPullRequestReviewComment.Sidethe side if the diff to which the comment applies
-
getPullRequestReviewId
public Long getPullRequestReviewId()
Gets The ID of the pull request review to which the comment belongs.- Returns:
Longthe ID of the pull request review
-
getPullRequestUrl
public URL getPullRequestUrl()
Gets URL for the pull request that the review comment belongs to.- Returns:
URLthe URL of the pull request
-
getBodyHtml
public String getBodyHtml()
Gets The body in html format.- Returns:
Stringthe body in html format
-
getReactions
public GHPullRequestReviewCommentReactions getReactions()
Gets the Reaction Rollup- Returns:
GHPullRequestReviewCommentReactionsthe reaction rollup
-
update
public void update(String body) throws IOException
Updates the comment.- Parameters:
body- the body- Throws:
IOException- the io exception
-
delete
public void delete() throws IOExceptionDeletes this review comment.- Throws:
IOException- the io exception
-
reply
public GHPullRequestReviewComment reply(String body) throws IOException
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
-
createReaction
@Preview(SQUIRREL_GIRL) public GHReaction createReaction(ReactionContent content) throws IOException
Creates the reaction.- Specified by:
createReactionin interfaceReactable- Parameters:
content- the content- Returns:
- the GH reaction
- Throws:
IOException- Signals that an I/O exception has occurred.
-
deleteReaction
public void deleteReaction(GHReaction reaction) throws IOException
Delete reaction.- Specified by:
deleteReactionin interfaceReactable- Parameters:
reaction- the reaction- Throws:
IOException- Signals that an I/O exception has occurred.
-
listReactions
@Preview(SQUIRREL_GIRL) public PagedIterable<GHReaction> listReactions()
List reactions.- Specified by:
listReactionsin interfaceReactable- Returns:
- the paged iterable
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-