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.
Since:
0.8
  • Constructor Details

    • Smart

      public Smart(GistComment cmt)
      Public ctor.
      Parameters:
      cmt - Comment
  • Method Details

    • 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 interface GistComment
      Returns:
      Owner of the comment
    • number

      public int number()
      Description copied from interface: GistComment
      Number.
      Specified by:
      number in interface GistComment
      Returns:
      Comment id
    • remove

      public void remove() throws IOException
      Description copied from interface: GistComment
      Delete the comment.
      Specified by:
      remove in interface GistComment
      Throws:
      IOException - If there is any I/O problem
    • compareTo

      public int compareTo(GistComment cmt)
      Specified by:
      compareTo in interface Comparable<GistComment>
    • patch

      public void patch(jakarta.json.JsonObject json) throws IOException
      Description copied from interface: JsonPatchable
      Patch using this JSON object.
      Specified by:
      patch in interface JsonPatchable
      Parameters:
      json - JSON object
      Throws:
      IOException - If there is any I/O problem
    • json

      public jakarta.json.JsonObject json() throws IOException
      Description copied from interface: JsonReadable
      Describe it in a JSON object.
      Specified by:
      json in interface JsonReadable
      Returns:
      JSON object
      Throws:
      IOException - If there is any I/O problem