Class GHProjectBuilder
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.builders.GHProjectBuilder
- All Implemented Interfaces:
HttpRequestInterface,JSONHelper
This class is used to build a new GitHub project.
It extends GHBase and provides methods for setting the project's name and body, and for building the project.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T> -
Constructor Summary
ConstructorsConstructorDescriptionGHProjectBuilder(Github github, String url) Constructs a new GHProjectBuilder instance with the provided GitHub instance and URL. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the project and returns a new GHProject instance.getBody()Returns the body of the project.Returns the GitHub instance.getName()Returns the name of the project.getUrl()Returns the URL.Sets the body of the project.Sets the name of the project.org.json.JSONObjectConverts the GHProjectBuilder instance to a JSONObject.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequestMethods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Constructor Details
-
GHProjectBuilder
Constructs a new GHProjectBuilder instance with the provided GitHub instance and URL.- Parameters:
github- the GitHub instanceurl- the URL
-
-
Method Details
-
setBody
Sets the body of the project.- Parameters:
body- the body of the project- Returns:
- the GHProjectBuilder instance
-
setName
Sets the name of the project.- Parameters:
name- the name of the project- Returns:
- the GHProjectBuilder instance
-
toJSONObject
public org.json.JSONObject toJSONObject()Converts the GHProjectBuilder instance to a JSONObject.- Overrides:
toJSONObjectin classGHBase- Returns:
- the JSONObject
-
build
Builds the project and returns a new GHProject instance.- Returns:
- the GHProject instance
-
getName
Returns the name of the project.- Returns:
- the name of the project
-
getGithub
Returns the GitHub instance.- Returns:
- the GitHub instance
-
getBody
Returns the body of the project.- Returns:
- the body of the project
-
getUrl
Returns the URL.- Returns:
- the URL
-