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, 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
-
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:GHBase
Returns a new JSONObject.- Overrides:
toJSONObject
in 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
-