Package org.kohsuke.github
Class GHCommitComment
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHCommitComment
-
- All Implemented Interfaces:
Reactable
public class GHCommitComment extends GHObject implements Reactable
A comment attached to a commit (or a specific line in a specific file of a commit.)- Author:
- Kohsuke Kawaguchi
- See Also:
GHRepository#listCommitComments(),GHCommit#listComments(),GHCommit#createComment(String, String, Integer, Integer)
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
created_at, id, responseHeaderFields, updated_at, url
-
-
Constructor Summary
Constructors Constructor Description GHCommitComment()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GHReactioncreateReaction(ReactionContent content)Deprecated.voiddelete()Deletes this comment.StringgetBody()Commit comment in the GitHub flavored markdown format.GHCommitgetCommit()Gets the commit to which this comment is associated with.URLgetHtmlUrl()URL like 'https://github.com/kohsuke/sandbox-ant/commit/8ae38db0ea5837313ab5f39d43a6f73de3bd9000#commitcomment-1252827' to show this commit comment in a browser.intgetLine()A commit comment can be on a specific line of a specific file, if so, this field points to the line number in the file.GHRepositorygetOwner()Gets owner.StringgetPath()A commit comment can be on a specific line of a specific file, if so, this field points to a file.StringgetSHA1()Gets sha 1.GHUsergetUser()Gets the user who put this comment.PagedIterable<GHReaction>listReactions()Deprecated.voidupdate(String body)Updates the body of the commit message.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getResponseHeaderFields, getUpdatedAt, getUrl, toString
-
-
-
-
Method Detail
-
getOwner
public GHRepository getOwner()
Gets owner.- Returns:
- the owner
-
getHtmlUrl
public URL getHtmlUrl()
URL like 'https://github.com/kohsuke/sandbox-ant/commit/8ae38db0ea5837313ab5f39d43a6f73de3bd9000#commitcomment-1252827' to show this commit comment in a browser.- Specified by:
getHtmlUrlin classGHObject- Returns:
- URL of this object for humans, which renders some HTML.
-
getSHA1
public String getSHA1()
Gets sha 1.- Returns:
- the sha 1
-
getBody
public String getBody()
Commit comment in the GitHub flavored markdown format.- Returns:
- the body
-
getPath
public String getPath()
A commit comment can be on a specific line of a specific file, if so, this field points to a file. Otherwise null.- Returns:
- the path
-
getLine
public int getLine()
A commit comment can be on a specific line of a specific file, if so, this field points to the line number in the file. Otherwise -1.- Returns:
- the line
-
getUser
public GHUser getUser() throws IOException
Gets the user who put this comment.- Returns:
- the user
- Throws:
IOException- the io exception
-
getCommit
public GHCommit getCommit() throws IOException
Gets the commit to which this comment is associated with.- Returns:
- the commit
- Throws:
IOException- the io exception
-
update
public void update(String body) throws IOException
Updates the body of the commit message.- Parameters:
body- the body- Throws:
IOException- the io exception
-
createReaction
@Preview @Deprecated public GHReaction createReaction(ReactionContent content) throws IOException
Deprecated.Description copied from interface:ReactableLeaves a reaction to this object.- Specified by:
createReactionin interfaceReactable- Parameters:
content- the content- Returns:
- the gh reaction
- Throws:
IOException- the io exception
-
listReactions
@Preview @Deprecated public PagedIterable<GHReaction> listReactions()
Deprecated.Description copied from interface:ReactableList all the reactions left to this object.- Specified by:
listReactionsin interfaceReactable- Returns:
- the paged iterable
-
delete
public void delete() throws IOExceptionDeletes this comment.- Throws:
IOException- the io exception
-
-