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 User
author()
Get its author.String
body()
Get its body.void
body(String text)
Change comment body.int
compareTo(GistComment cmt)
Date
createdAt()
When this comment was created.Gist
gist()
The gist 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
remove()
Delete the comment.Date
updatedAt()
When this comment was updated last time.URL
url()
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:GistComment
The gist it's in.- Specified by:
gist
in interfaceGistComment
- Returns:
- Owner of the comment
-
number
public int number()
Description copied from interface:GistComment
Number.- Specified by:
number
in interfaceGistComment
- Returns:
- Comment id
-
remove
public void remove() throws IOException
Description copied from interface:GistComment
Delete the comment.- Specified by:
remove
in interfaceGistComment
- Throws:
IOException
- If there is any I/O problem- See Also:
- Delete a Comment
-
compareTo
public int compareTo(GistComment cmt)
- Specified by:
compareTo
in interfaceComparable<GistComment>
-
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
-
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
-
-