Package com.jcabi.github
Interface Comment
-
- All Superinterfaces:
Comparable<Comment>,JsonPatchable,JsonReadable
- All Known Implementing Classes:
Comment.Smart,SfComment
@Immutable public interface Comment extends Comparable<Comment>, JsonReadable, JsonPatchable
Github issue comment.Comment implements
JsonReadable, that's how you can get its full details in JSON format. For example, to get its author's Github login you get the entire JSON and then gets its element:String login = comment.json() .getJsonObject("user") .getString("login");However, it's better to use a supplementary "smart" decorator, which automates most of these operations:
String login = new Comment.Smart(comment).author().login();
- Since:
- 0.1
- Version:
- $Id: aba3655ac08357e80033ec3eaa98ac7a6761a151 $
- Author:
- Yegor Bugayenko (yegor256@gmail.com), Paulo Lobo (pauloeduardolobo@gmail.com)
- See Also:
- Issue Comments API
- Suppressed Checkstyle violations:
- MultipleStringLiterals (500 lines)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classComment.SmartSmart comment with additional features.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Issueissue()The issue it's in.intnumber()Number.voidreact(Reaction reaction)Adds the reaction to the comment.Iterable<Reaction>reactions()List the reactions of the comment.voidremove()Delete the comment.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.jcabi.github.JsonPatchable
patch
-
Methods inherited from interface com.jcabi.github.JsonReadable
json
-
-
-
-
Method Detail
-
issue
Issue issue()
The issue it's in.- Returns:
- Owner of the comment
-
number
int number()
Number.- Returns:
- Comment number
-
remove
void remove() throws IOExceptionDelete the comment.- Throws:
IOException- If there is any I/O problem- See Also:
- Delete a Comment
-
react
void react(Reaction reaction) throws IOException
Adds the reaction to the comment.- Parameters:
reaction- Reaction to be added.- Throws:
IOException- In case something goes wrong.
-
-