Package com.jcabi.github
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Gist
Gist.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GistComments
comments()
Get all comments of the gist.Iterable<String>
files()
Get a list of all file names in the gist.Gist
fork()
Fork the gist.Github
github()
Github we're in.String
identifier()
Get gist id.javax.json.JsonObject
json()
Describe it in a JSON object.void
patch(javax.json.JsonObject json)
Patch using this JSON object.String
read(String name)
Read file content.void
star()
Star a gist.boolean
starred()
Checks if Gist is starred.void
unstar()
Unstar a gist.void
write(String name, String content)
Write file content.
-
-
-
Constructor Detail
-
Smart
public Smart(Gist gst)
Public ctor.- Parameters:
gst
- Gist
-
-
Method Detail
-
identifier
public String identifier()
Get gist id.- Specified by:
identifier
in interfaceGist
- Returns:
- Gist id
-
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
-
read
public String read(String name) throws IOException
Description copied from interface:Gist
Read file content.- Specified by:
read
in interfaceGist
- Parameters:
name
- Name of it- Returns:
- File content
- Throws:
IOException
- If there is any I/O problem- See Also:
- Get a Single Gist
-
write
public void write(String name, String content) throws IOException
Description copied from interface:Gist
Write file content.- Specified by:
write
in interfaceGist
- Parameters:
name
- Name of itcontent
- Content to write- Throws:
IOException
- If there is any I/O problem- See Also:
- Edit a Gist
-
star
public void star() throws IOException
Description copied from interface:Gist
Star a gist.- Specified by:
star
in interfaceGist
- 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 interfaceGist
- 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 interfaceGist
- 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 interfaceGist
- 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 interfaceGist
- Returns:
- GistComments
- Throws:
IOException
- If there is any I/O problem- See Also:
- Gist Comments API
-
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
-
-