Package com.jcabi.github
Class GistComment.Smart
- java.lang.Object
-
- com.jcabi.github.GistComment.Smart
-
- All Implemented Interfaces:
GistComment,JsonPatchable,JsonReadable,Comparable<GistComment>
- Enclosing interface:
- GistComment
@Immutable @Loggable(1) public static final class GistComment.Smart extends Object implements GistComment
Smart comment with additional features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.GistComment
GistComment.Smart
-
-
Constructor Summary
Constructors Constructor Description Smart(GistComment cmt)Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Userauthor()Get its author.Stringbody()Get its body.voidbody(String text)Change comment body.intcompareTo(GistComment cmt)DatecreatedAt()When this comment was created.Gistgist()The gist it's in.javax.json.JsonObjectjson()Describe it in a JSON object.intnumber()Number.voidpatch(javax.json.JsonObject json)Patch using this JSON object.voidremove()Delete the comment.DateupdatedAt()When this comment was updated last time.URLurl()Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(GistComment 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
-
gist
public Gist gist()
Description copied from interface:GistCommentThe gist it's in.- Specified by:
gistin interfaceGistComment- Returns:
- Owner of the comment
-
number
public int number()
Description copied from interface:GistCommentNumber.- Specified by:
numberin interfaceGistComment- Returns:
- Comment id
-
remove
public void remove() throws IOExceptionDescription copied from interface:GistCommentDelete the comment.- Specified by:
removein interfaceGistComment- Throws:
IOException- If there is any I/O problem- See Also:
- Delete a Comment
-
compareTo
public int compareTo(GistComment cmt)
- Specified by:
compareToin interfaceComparable<GistComment>
-
patch
public void patch(javax.json.JsonObject json) throws IOExceptionDescription copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
json
public javax.json.JsonObject json() throws IOExceptionDescription copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
- Throws:
IOException- If there is any I/O problem
-
-