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 void
assign(String login)
Assign this issue to another user.User
assignee()
Get its assignee.User
author()
Get its author.String
body()
Get its body.void
body(String text)
Change its body.void
close()
Close it (make sure it's closed).Date
closedAt()
When this issue was closed.Comments
comments()
Get all comments of the issue.int
compareTo(Issue obj)
Date
createdAt()
When this issue was created.Iterable<Event>
events()
Get all events of the issue.boolean
exists()
Does this issue exist in Github?boolean
hasAssignee()
Has assignee?boolean
hasBody()
Has body?boolean
hasMilestone()
Does issue have milestone?URL
htmlUrl()
Get its HTML URL.boolean
isLocked()
The issue conversation is locked?boolean
isOpen()
Is it open?boolean
isPull()
Is it a pull request?javax.json.JsonObject
json()
Describe it in a JSON object.IssueLabels
labels()
Get all labels of the issue.Event
latestEvent(String type)
Get the latest event of a given type.void
lock(String reason)
Locks the issue.Milestone
milestone()
Get milestone for this issue.void
milestone(Milestone milestone)
Add issueto milestone.int
number()
Get its number.void
open()
Open it (make sure it's open).void
patch(javax.json.JsonObject json)
Patch using this JSON object.Pull
pull()
Get pull request.void
react(Reaction reaction)
Adds the reaction to the issue.Collection<Reaction>
reactions()
List the reactions of the issue.Repo
repo()
Repository we're in.IssueLabels
roLabels()
Get read-only labels.String
state()
Get its state.void
state(String state)
Change its state.String
title()
Get its title.void
title(String text)
Change its title.void
unlock()
Unlocks the issue.Date
updatedAt()
When this issue was updated.URL
url()
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 IOException
Is it open?- Returns:
- TRUE if it's open
- Throws:
IOException
- If there is any I/O problem
-
open
public void open() throws IOException
Open it (make sure it's open).- Throws:
IOException
- If there is any I/O problem
-
close
public void close() throws IOException
Close 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 IOException
Has body?- Returns:
- TRUE if body exists
- Throws:
IOException
- If there is any I/O problem- Since:
- 0.22
-
hasAssignee
public boolean hasAssignee() throws IOException
Has 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 IOException
Is 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. ThrowsIllegalStateException
if 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 IOException
Does 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:Issue
Get its number.
-
comments
public Comments comments()
Description copied from interface:Issue
Get all comments of the issue.- Specified by:
comments
in interfaceIssue
- Returns:
- Comments
- See Also:
- Issue Comments API
-
labels
public IssueLabels labels()
Description copied from interface:Issue
Get all labels of the issue.- Specified by:
labels
in interfaceIssue
- Returns:
- Labels
- See Also:
- Labels API
-
events
public Iterable<Event> events() throws IOException
Description copied from interface:Issue
Get all events of the issue.- Specified by:
events
in 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 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
-
compareTo
public int compareTo(Issue obj)
- Specified by:
compareTo
in interfaceComparable<Issue>
-
exists
public boolean exists() throws IOException
Description copied from interface:Issue
Does this issue exist in Github?- Specified by:
exists
in 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:Issue
Adds the reaction to the issue.
-
reactions
public Collection<Reaction> reactions()
Description copied from interface:Issue
List the reactions of the issue.
-
unlock
public void unlock()
Description copied from interface:Issue
Unlocks the issue.
-
-