Class GHIssueBuilder
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.builders.GHIssueBuilder
- All Implemented Interfaces:
HttpRequestInterface
,JSONHelper
The GHIssueBuilder class is used to build and create GitHub issues.
This class provides methods to set various properties of an issue such as title, body, assignee, milestone, and labels.
It extends the GHBase class and implements the JSONHelper and HttpRequestInterface interfaces.
This class is part of the builder pattern to simplify issue creation on GitHub.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T>
-
Constructor Summary
ConstructorsConstructorDescriptionGHIssueBuilder
(Github github, String url, String title) Constructs a new GHIssueBuilder instance with the specified GitHub instance and title.GHIssueBuilder
(Github github, String url, String title, String body) Constructs a new GHIssueBuilder instance with the specified GitHub instance, title, and body. -
Method Summary
Modifier and TypeMethodDescriptionAdds a label to the issue.Sets the assignee of the issue.create()
Creates a new GHIssue instance based on the current state of the builder.getBody()
getState()
getTitle()
Returns the title of the issue.getUrl()
void
void
setMilestone
(GHMilestone milestone) void
Sets the title of the issue.org.json.JSONObject
Converts the current state of the builder to a JSONObject.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequest
Methods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Constructor Details
-
GHIssueBuilder
Constructs a new GHIssueBuilder instance with the specified GitHub instance and title.- Parameters:
github
- the GitHub instancetitle
- the title of the issue
-
GHIssueBuilder
Constructs a new GHIssueBuilder instance with the specified GitHub instance, title, and body.- Parameters:
github
- the GitHub instancetitle
- the title of the issuebody
- the body of the issue
-
-
Method Details
-
setTitle
Sets the title of the issue.- Parameters:
title
- the title to set
-
assignee
Sets the assignee of the issue.- Parameters:
user
- the username of the assignee- Returns:
- the current instance of GHIssueBuilder
-
addLabel
Adds a label to the issue.- Parameters:
label
- the label to be added to the issue- Returns:
- the current instance of GHIssueBuilder
-
create
Creates a new GHIssue instance based on the current state of the builder.- Returns:
- a new GHIssue instance
-
getTitle
Returns the title of the issue.- Returns:
- the title of the issue
-
getBody
-
setBody
-
setMilestone
-
getGithub
-
getUrl
-
getLabels
-
getMilestone
-
getState
-
getAssignees
-
toJSONObject
public org.json.JSONObject toJSONObject()Converts the current state of the builder to a JSONObject.- Overrides:
toJSONObject
in classGHBase
- Returns:
- a JSONObject representing the current state of the builder
-