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 GHCommentaddComment(String comment)Add a comment.voidaddLabel(GHLabel label)Add label to this issue.voidaddLabels(List<GHLabel> labels)Add labels to this issue.voidassignTo(String ghUsername)Assign this issue to another user.voidclose()Close this issue.StringgetBody()Get the body of this issue.List<GHComment>getComments()Get comments.intgetId()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.StringgetTitle()Get the title of this issue.booleanisClosed()booleanisOpen()voidsetMilestone(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 FB2GHExceptionClose this issue.- Throws:
FB2GHException- if a GitHub error occurs
-
isOpen
public boolean isOpen() throws FB2GHException- Returns:
trueif the issue is open.falseif it is closed- Throws:
FB2GHException- if a GitHub error occurs
-
isClosed
public boolean isClosed() throws FB2GHException- Returns:
trueif the issue is closed.falseif 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
Optionalwhich 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- TheGHMilestoneto associate this issue with ornullto 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 FB2GHExceptionGet the ID of this issue.- Returns:
- ID of issue
- Throws:
FB2GHException- if a GitHub error occurs
-
-