Package com.jcabi.github
Class Issue.Smart
- java.lang.Object
-
- com.jcabi.github.Issue.Smart
-
- All Implemented Interfaces:
Issue,JsonPatchable,JsonReadable,Comparable<Issue>
- Enclosing interface:
- Issue
@Immutable @Loggable(1) public static final class Issue.Smart extends Object implements Issue
Smart Issue with extra features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Issue
Issue.Smart
-
-
Field Summary
-
Fields inherited from interface com.jcabi.github.Issue
CLOSED_STATE, OPEN_STATE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(String login)Assign this issue to another user.Userassignee()Get its assignee.Userauthor()Get its author.Stringbody()Get its body.voidbody(String text)Change its body.voidclose()Close it (make sure it's closed).DateclosedAt()When this issue was closed.Commentscomments()Get all comments of the issue.intcompareTo(Issue obj)DatecreatedAt()When this issue was created.Iterable<Event>events()Get all events of the issue.booleanexists()Does this issue exist in Github?booleanhasAssignee()Has assignee?booleanhasBody()Has body?booleanhasMilestone()Does issue have milestone?URLhtmlUrl()Get its HTML URL.booleanisLocked()The issue conversation is locked?booleanisOpen()Is it open?booleanisPull()Is it a pull request?javax.json.JsonObjectjson()Describe it in a JSON object.IssueLabelslabels()Get all labels of the issue.EventlatestEvent(String type)Get the latest event of a given type.voidlock(String reason)Locks the issue.Milestonemilestone()Get milestone for this issue.voidmilestone(Milestone milestone)Add issueto milestone.intnumber()Get its number.voidopen()Open it (make sure it's open).voidpatch(javax.json.JsonObject json)Patch using this JSON object.Pullpull()Get pull request.voidreact(Reaction reaction)Adds the reaction to the issue.Collection<Reaction>reactions()List the reactions of the issue.Reporepo()Repository we're in.IssueLabelsroLabels()Get read-only labels.Stringstate()Get its state.voidstate(String state)Change its state.Stringtitle()Get its title.voidtitle(String text)Change its title.voidunlock()Unlocks the issue.DateupdatedAt()When this issue was updated.URLurl()Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(Issue iss)
Public ctor.- Parameters:
iss- Issue
-
-
Method Detail
-
author
public User author() throws IOException
Get its author.- Returns:
- Author of issue (who submitted it)
- Throws:
IOException- If there is any I/O problem
-
isOpen
public boolean isOpen() throws IOExceptionIs it open?- Returns:
- TRUE if it's open
- Throws:
IOException- If there is any I/O problem
-
open
public void open() throws IOExceptionOpen it (make sure it's open).- Throws:
IOException- If there is any I/O problem
-
close
public void close() throws IOExceptionClose it (make sure it's closed).- Throws:
IOException- If there is any I/O problem
-
state
public String state() throws IOException
Get its state.- Returns:
- State of issue
- Throws:
IOException- If there is any I/O problem
-
state
public void state(String state) throws IOException
Change its state.- Parameters:
state- State of issue- Throws:
IOException- If there is any I/O problem
-
title
public String title() throws IOException
Get its title.- Returns:
- Title of issue
- Throws:
IOException- If there is any I/O problem
-
title
public void title(String text) throws IOException
Change its title.- Parameters:
text- Title of issue- Throws:
IOException- If there is any I/O problem
-
body
public String body() throws IOException
Get its body.- Returns:
- Body of issue
- Throws:
IOException- If there is any I/O problem
-
body
public void body(String text) throws IOException
Change its body.- Parameters:
text- Body of issue- Throws:
IOException- If there is any I/O problem
-
hasBody
public boolean hasBody() throws IOExceptionHas body?- Returns:
- TRUE if body exists
- Throws:
IOException- If there is any I/O problem- Since:
- 0.22
-
hasAssignee
public boolean hasAssignee() throws IOExceptionHas assignee?- Returns:
- TRUE if assignee exists
- Throws:
IOException- If there is any I/O problem
-
assignee
public User assignee() throws IOException
Get its assignee.- Returns:
- User Assignee of issue
- Throws:
IOException- If there is any I/O problem
-
assign
public void assign(String login) throws IOException
Assign this issue to another user.- Parameters:
login- Login of the user to assign to- Throws:
IOException- If there is any I/O problem
-
url
public URL url() throws IOException
Get its URL.- Returns:
- URL of issue
- Throws:
IOException- If there is any I/O problem
-
htmlUrl
public URL htmlUrl() throws IOException
Get its HTML URL.- Returns:
- URL of issue
- Throws:
IOException- If there is any I/O problem
-
createdAt
public Date createdAt() throws IOException
When this issue was created.- Returns:
- Date of creation
- Throws:
IOException- If there is any I/O problem
-
closedAt
public Date closedAt() throws IOException
When this issue was closed.- Returns:
- Date of creation
- Throws:
IOException- If there is any I/O problem- Since:
- 0.34
-
updatedAt
public Date updatedAt() throws IOException
When this issue was updated.- Returns:
- Date of update
- Throws:
IOException- If there is any I/O problem
-
isPull
public boolean isPull() throws IOExceptionIs it a pull request?- Returns:
- TRUE if it is a pull request
- Throws:
IOException- If there is any I/O problem
-
pull
public Pull pull() throws IOException
Get pull request.- Returns:
- Pull request
- Throws:
IOException- If there is any I/O problem
-
latestEvent
public Event latestEvent(String type) throws IOException
Get the latest event of a given type. ThrowsIllegalStateExceptionif the issue has no events of the given type.- Parameters:
type- Type of event- Returns:
- Latest event of the given type
- Throws:
IOException- If there is any I/O problem
-
roLabels
public IssueLabels roLabels() throws IOException
Get read-only labels.- Returns:
- Collection of labels
- Throws:
IOException- If there is any I/O problem- Since:
- 0.6.2
-
hasMilestone
public boolean hasMilestone() throws IOExceptionDoes issue have milestone?- Returns:
- True if has
- Throws:
IOException- If fails
-
milestone
public Milestone milestone() throws IOException
Get milestone for this issue.- Returns:
- Milestone
- Throws:
IOException- If fails
-
milestone
public void milestone(Milestone milestone) throws IOException
Add issueto milestone.- Parameters:
milestone- Milestone- Throws:
IOException- If fails
-
number
public int number()
Description copied from interface:IssueGet its number.
-
comments
public Comments comments()
Description copied from interface:IssueGet all comments of the issue.- Specified by:
commentsin interfaceIssue- Returns:
- Comments
- See Also:
- Issue Comments API
-
labels
public IssueLabels labels()
Description copied from interface:IssueGet all labels of the issue.- Specified by:
labelsin interfaceIssue- Returns:
- Labels
- See Also:
- Labels API
-
events
public Iterable<Event> events() throws IOException
Description copied from interface:IssueGet all events of the issue.- Specified by:
eventsin interfaceIssue- Returns:
- Events
- Throws:
IOException- If there is any I/O problem- See Also:
- List Events for an Issue
-
json
public javax.json.JsonObject json() throws IOExceptionDescription copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
- Throws:
IOException- If there is any I/O problem
-
patch
public void patch(javax.json.JsonObject json) throws IOExceptionDescription copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
compareTo
public int compareTo(Issue obj)
- Specified by:
compareToin interfaceComparable<Issue>
-
exists
public boolean exists() throws IOExceptionDescription copied from interface:IssueDoes this issue exist in Github?- Specified by:
existsin interfaceIssue- Returns:
- TRUE if this issue exists
- Throws:
IOException- If there is any I/O problem
-
react
public void react(Reaction reaction)
Description copied from interface:IssueAdds the reaction to the issue.
-
reactions
public Collection<Reaction> reactions()
Description copied from interface:IssueList the reactions of the issue.
-
unlock
public void unlock()
Description copied from interface:IssueUnlocks the issue.
-
-