Package com.jcabi.github
Class Comment.Smart
- java.lang.Object
-
- com.jcabi.github.Comment.Smart
-
- All Implemented Interfaces:
Comment
,JsonPatchable
,JsonReadable
,Comparable<Comment>
- Enclosing interface:
- Comment
@Immutable @Loggable(1) public static final class Comment.Smart extends Object implements Comment
Smart comment with additional features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Comment
Comment.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
author()
Get its author.String
body()
Get its body.void
body(String text)
Change comment body.int
compareTo(Comment obj)
Date
createdAt()
When this comment was created.Issue
issue()
The issue it's in.javax.json.JsonObject
json()
Describe it in a JSON object.int
number()
Number.void
patch(javax.json.JsonObject json)
Patch using this JSON object.void
react(Reaction reaction)
Adds the reaction to the comment.Collection<Reaction>
reactions()
List the reactions of the comment.void
remove()
Delete the comment.Date
updatedAt()
When this comment was updated last time.URL
url()
Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(Comment cmt)
Public ctor.- Parameters:
cmt
- Comment
-
-
Method Detail
-
author
public User author() throws IOException
Get its author.- Returns:
- Author of comment
- Throws:
IOException
- If there is any I/O problem
-
body
public String body() throws IOException
Get its body.- Returns:
- Body of comment
- Throws:
IOException
- If there is any I/O problem
-
body
public void body(String text) throws IOException
Change comment body.- Parameters:
text
- Body of comment- Throws:
IOException
- If there is any I/O problem
-
url
public URL url() throws IOException
Get its URL.- Returns:
- URL of comment
- Throws:
IOException
- If there is any I/O problem
-
createdAt
public Date createdAt() throws IOException
When this comment was created.- Returns:
- Date of creation
- Throws:
IOException
- If there is any I/O problem
-
updatedAt
public Date updatedAt() throws IOException
When this comment was updated last time.- Returns:
- Date of update
- Throws:
IOException
- If there is any I/O problem
-
number
public int number()
Description copied from interface:Comment
Number.
-
remove
public void remove() throws IOException
Description copied from interface:Comment
Delete the comment.- Specified by:
remove
in interfaceComment
- Throws:
IOException
- If there is any I/O problem- See Also:
- Delete a Comment
-
react
public void react(Reaction reaction)
Description copied from interface:Comment
Adds the reaction to the comment.
-
reactions
public Collection<Reaction> reactions()
Description copied from interface:Comment
List the reactions of the comment.
-
json
public javax.json.JsonObject json() throws IOException
Description copied from interface:JsonReadable
Describe it in a JSON object.- Specified by:
json
in interfaceJsonReadable
- Returns:
- JSON object
- Throws:
IOException
- If there is any I/O problem
-
patch
public void patch(javax.json.JsonObject json) throws IOException
Description copied from interface:JsonPatchable
Patch using this JSON object.- Specified by:
patch
in interfaceJsonPatchable
- Parameters:
json
- JSON object- Throws:
IOException
- If there is any I/O problem
-
compareTo
public int compareTo(Comment obj)
- Specified by:
compareTo
in interfaceComparable<Comment>
-
-