Class Gist.Smart

java.lang.Object
com.jcabi.github.Gist.Smart
All Implemented Interfaces:
Gist, JsonPatchable, JsonReadable
Enclosing interface:
Gist

@Immutable @Loggable(1) public static final class Gist.Smart extends Object implements Gist
Smart Gist with extra features.
Since:
0.5
  • Constructor Details

    • Smart

      public Smart(Gist gst)
      Public ctor.
      Parameters:
      gst - Gist
  • Method Details

    • identifier

      public String identifier()
      Description copied from interface: Gist
      Get gist identifier.
      Specified by:
      identifier in interface Gist
      Returns:
      Gist identifier
    • files

      public Iterable<String> files() throws IOException
      Get a list of all file names in the gist.
      Returns:
      File names
      Throws:
      IOException - If there is any I/O problem
    • github

      public GitHub github()
      Description copied from interface: Gist
      GitHub we're in.
      Specified by:
      github in interface Gist
      Returns:
      GitHub
    • read

      public String read(String name) throws IOException
      Description copied from interface: Gist
      Read file content.
      Specified by:
      read in interface Gist
      Parameters:
      name - Name of it
      Returns:
      File content
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • write

      public void write(String name, String content) throws IOException
      Description copied from interface: Gist
      Write file content.
      Specified by:
      write in interface Gist
      Parameters:
      name - Name of it
      content - Content to write
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • star

      public void star() throws IOException
      Description copied from interface: Gist
      Star a gist.
      Specified by:
      star in interface Gist
      Throws:
      IOException - If there is any I/O problem
    • unstar

      public void unstar() throws IOException
      Description copied from interface: Gist
      Unstar a gist.
      Specified by:
      unstar in interface Gist
      Throws:
      IOException - If there is any I/O problem
    • starred

      public boolean starred() throws IOException
      Description copied from interface: Gist
      Checks if Gist is starred.
      Specified by:
      starred in interface Gist
      Returns:
      True if gist is starred
      Throws:
      IOException - If there is any I/O problem
    • fork

      public Gist fork() throws IOException
      Description copied from interface: Gist
      Fork the gist.
      Specified by:
      fork in interface Gist
      Returns:
      Forked gist
      Throws:
      IOException - If there is any I/O problem
    • comments

      public GistComments comments() throws IOException
      Description copied from interface: Gist
      Get all comments of the gist.
      Specified by:
      comments in interface Gist
      Returns:
      GistComments
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • 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
    • 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