Package com.jcabi.github
Interface Issue
-
- All Superinterfaces:
Comparable<Issue>
,JsonPatchable
,JsonReadable
- All Known Implementing Classes:
Issue.Smart
,SfIssue
@Immutable public interface Issue extends Comparable<Issue>, JsonReadable, JsonPatchable
Github issue.Use a supplementary "smart" decorator to get other properties from an issue, for example:
Issue.Smart issue = new Issue.Smart(origin); if (issue.isOpen()) { issue.close(); }
- Since:
- 0.1
- Version:
- $Id: ba8cb9827fa813e3e40b72511cc1bf93d9704245 $
- Author:
- Yegor Bugayenko (yegor256@gmail.com)
- See Also:
- Issues API
- To do:
- #1462:30min Implement lock reason validation. According to documentation lock reason must belong to a specific value domain. This validation must be performed in lock method and tests must be added to ensure that the class is accepting the correct values and rejecting the wrong ones.
- Suppressed Checkstyle violations:
- MultipleStringLiterals (500 lines)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Issue.Smart
Smart Issue with extra features.
-
Field Summary
Fields Modifier and Type Field Description static String
CLOSED_STATE
Issue state.static String
OPEN_STATE
Issue state.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Comments
comments()
Get all comments of the issue.Iterable<Event>
events()
Get all events of the issue.boolean
exists()
Does this issue exist in Github?boolean
isLocked()
The issue conversation is locked?IssueLabels
labels()
Get all labels of the issue.void
lock(String reason)
Locks the issue.int
number()
Get its number.void
react(Reaction reaction)
Adds the reaction to the issue.Iterable<Reaction>
reactions()
List the reactions of the issue.Repo
repo()
Repository we're in.void
unlock()
Unlocks the issue.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.jcabi.github.JsonPatchable
patch
-
Methods inherited from interface com.jcabi.github.JsonReadable
json
-
-
-
-
Field Detail
-
OPEN_STATE
static final String OPEN_STATE
Issue state.- See Also:
- Constant Field Values
-
CLOSED_STATE
static final String CLOSED_STATE
Issue state.- See Also:
- Constant Field Values
-
-
Method Detail
-
repo
Repo repo()
Repository we're in.- Returns:
- Repo
-
number
int number()
Get its number.- Returns:
- Issue number
-
comments
Comments comments()
Get all comments of the issue.- Returns:
- Comments
- See Also:
- Issue Comments API
-
labels
IssueLabels labels()
Get all labels of the issue.- Returns:
- Labels
- See Also:
- Labels API
-
events
Iterable<Event> events() throws IOException
Get all events of the issue.- Returns:
- Events
- Throws:
IOException
- If there is any I/O problem- See Also:
- List Events for an Issue
-
exists
boolean exists() throws IOException
Does this issue exist in Github?- Returns:
- TRUE if this issue exists
- Throws:
IOException
- If there is any I/O problem
-
react
void react(Reaction reaction) throws IOException
Adds the reaction to the issue.- Parameters:
reaction
- Reaction to be added.- Throws:
IOException
- If there is any I/O problem
-
lock
void lock(String reason)
Locks the issue.- Parameters:
reason
- Lock reason
-
unlock
void unlock()
Unlocks the issue.
-
isLocked
boolean isLocked()
The issue conversation is locked?- Returns:
- If the issue is locked.
-
-