Package com.sudicode.fb2gh.github
Class GHIssue
- java.lang.Object
-
- com.sudicode.fb2gh.github.GHIssue
-
public class GHIssue extends Object
GitHub issue.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHComment
addComment(String comment)
Add a comment.void
addLabel(GHLabel label)
Add label to this issue.void
addLabels(List<GHLabel> labels)
Add labels to this issue.void
assignTo(String ghUsername)
Assign this issue to another user.void
close()
Close this issue.String
getBody()
Get the body of this issue.List<GHComment>
getComments()
Get comments.int
getId()
Get the ID of this issue.List<GHLabel>
getLabels()
Get labels from this issue.Optional<GHMilestone>
getMilestone()
Get the milestone of this issue, if one exists.String
getTitle()
Get the title of this issue.boolean
isClosed()
boolean
isOpen()
void
setMilestone(GHMilestone milestone)
Add this issue to a milestone.
-
-
-
Method Detail
-
getLabels
public List<GHLabel> getLabels() throws FB2GHException
Get labels from this issue.- Returns:
- The labels
- Throws:
FB2GHException
- if a GitHub error occurs
-
addLabel
public void addLabel(GHLabel label) throws FB2GHException
Add label to this issue.- Parameters:
label
- The label to add- Throws:
FB2GHException
- if a GitHub error occurs
-
addLabels
public void addLabels(List<GHLabel> labels) throws FB2GHException
Add labels to this issue.- Parameters:
labels
- The labels to add- Throws:
FB2GHException
- if a GitHub error occurs
-
getComments
public List<GHComment> getComments() throws FB2GHException
Get comments.- Returns:
- All comments on this issue.
- Throws:
FB2GHException
- if a GitHub error occurs
-
addComment
public GHComment addComment(String comment) throws FB2GHException
Add a comment.- Parameters:
comment
- The contents of the comment. Supports Markdown.- Returns:
- The added comment.
- Throws:
FB2GHException
- if a GitHub error occurs
-
close
public void close() throws FB2GHException
Close this issue.- Throws:
FB2GHException
- if a GitHub error occurs
-
isOpen
public boolean isOpen() throws FB2GHException
- Returns:
true
if the issue is open.false
if it is closed- Throws:
FB2GHException
- if a GitHub error occurs
-
isClosed
public boolean isClosed() throws FB2GHException
- Returns:
true
if the issue is closed.false
if it is open- Throws:
FB2GHException
- if a GitHub error occurs
-
assignTo
public void assignTo(String ghUsername) throws FB2GHException
Assign this issue to another user.- Parameters:
ghUsername
- GitHub username- Throws:
FB2GHException
- if a GitHub error occurs
-
getMilestone
public Optional<GHMilestone> getMilestone() throws FB2GHException
Get the milestone of this issue, if one exists.- Returns:
- An
Optional
which contains the milestone if one exists. - Throws:
FB2GHException
- if a GitHub error occurs
-
setMilestone
public void setMilestone(GHMilestone milestone) throws FB2GHException
Add this issue to a milestone. NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise.- Parameters:
milestone
- TheGHMilestone
to associate this issue with ornull
to remove current.- Throws:
FB2GHException
- if a GitHub error occurs
-
getTitle
public String getTitle() throws FB2GHException
Get the title of this issue.- Returns:
- Title of issue
- Throws:
FB2GHException
- if a GitHub error occurs
-
getBody
public String getBody() throws FB2GHException
Get the body of this issue.- Returns:
- Body of issue
- Throws:
FB2GHException
- if a GitHub error occurs
-
getId
public int getId() throws FB2GHException
Get the ID of this issue.- Returns:
- ID of issue
- Throws:
FB2GHException
- if a GitHub error occurs
-
-