mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-23 15:50:48 +00:00
Add JavaDocs
Do using IntelliJ JavaDocs plugin. Better to have something than nothing.
This commit is contained in:
@@ -11,9 +11,10 @@ import static org.kohsuke.github.Previews.*;
|
||||
* A comment attached to a commit (or a specific line in a specific file of a commit.)
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
* @see GHRepository#listCommitComments()
|
||||
* @see GHCommit#listComments()
|
||||
* @see GHCommit#createComment(String, String, Integer, Integer)
|
||||
* @see GHRepository#listCommitComments() GHRepository#listCommitComments()
|
||||
* @see GHCommit#listComments() GHCommit#listComments()
|
||||
* @see GHCommit#createComment(String, String, Integer, Integer) GHCommit#createComment(String, String, Integer,
|
||||
* Integer)
|
||||
*/
|
||||
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD",
|
||||
"NP_UNWRITTEN_FIELD" }, justification = "JSON API")
|
||||
@@ -25,6 +26,11 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
String path;
|
||||
GHUser user; // not fully populated. beware.
|
||||
|
||||
/**
|
||||
* Gets owner.
|
||||
*
|
||||
* @return the owner
|
||||
*/
|
||||
public GHRepository getOwner() {
|
||||
return owner;
|
||||
}
|
||||
@@ -38,12 +44,19 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
return GitHub.parseURL(html_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets sha 1.
|
||||
*
|
||||
* @return the sha 1
|
||||
*/
|
||||
public String getSHA1() {
|
||||
return commit_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Commit comment in the GitHub flavored markdown format.
|
||||
*
|
||||
* @return the body
|
||||
*/
|
||||
public String getBody() {
|
||||
return body;
|
||||
@@ -52,6 +65,8 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
/**
|
||||
* A commit comment can be on a specific line of a specific file, if so, this field points to a file. Otherwise
|
||||
* null.
|
||||
*
|
||||
* @return the path
|
||||
*/
|
||||
public String getPath() {
|
||||
return path;
|
||||
@@ -60,6 +75,8 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return the line
|
||||
*/
|
||||
public int getLine() {
|
||||
return line != null ? line : -1;
|
||||
@@ -67,6 +84,10 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
|
||||
/**
|
||||
* Gets the user who put this comment.
|
||||
*
|
||||
* @return the user
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public GHUser getUser() throws IOException {
|
||||
return owner == null || owner.root.isOffline() ? user : owner.root.getUser(user.login);
|
||||
@@ -74,6 +95,10 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
|
||||
/**
|
||||
* Gets the commit to which this comment is associated with.
|
||||
*
|
||||
* @return the commit
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public GHCommit getCommit() throws IOException {
|
||||
return getOwner().getCommit(getSHA1());
|
||||
@@ -81,6 +106,11 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
|
||||
/**
|
||||
* Updates the body of the commit message.
|
||||
*
|
||||
* @param body
|
||||
* the body
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public void update(String body) throws IOException {
|
||||
new Requester(owner.root).with("body", body).method("PATCH").to(getApiTail(), GHCommitComment.class);
|
||||
@@ -103,6 +133,9 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
|
||||
/**
|
||||
* Deletes this comment.
|
||||
*
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public void delete() throws IOException {
|
||||
new Requester(owner.root).method("DELETE").to(getApiTail());
|
||||
|
||||
Reference in New Issue
Block a user