Class GHLicense
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.entities.repositories.GHLicense
- All Implemented Interfaces:
HttpRequestInterface,JSONHelper
This class represents a GitHub license.
It provides methods for fetching data about the license such as its name, SPDX ID, key, URL, and node ID.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T> -
Constructor Summary
ConstructorsConstructorDescriptionGHLicense(org.json.JSONObject jsonObject) Constructs a new GHLicense instance with the provided JSON object. -
Method Summary
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
-
GHLicense
public GHLicense(org.json.JSONObject jsonObject) Constructs a new GHLicense instance with the provided JSON object.- Parameters:
jsonObject- the JSON object containing the license data
-
-
Method Details
-
toJSONObject
public org.json.JSONObject toJSONObject()Description copied from class:GHBaseReturns a new JSONObject.- Overrides:
toJSONObjectin classGHBase- Returns:
- a new JSONObject
-
getUrl
Returns the URL of the license.- Returns:
- the URL of the license
-
getName
Returns the name of the license.- Returns:
- the name of the license
-
getKey
Returns the key of the license.- Returns:
- the key of the license
-
getNodeId
Returns the node ID of the license.- Returns:
- the node ID of the license
-
getSpdxId
Returns the SPDX ID of the license.- Returns:
- the SPDX ID of the license
-