Class GHEvent
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.entities.GHEvent
- All Implemented Interfaces:
HttpRequestInterface
,JSONHelper
This class represents a GitHub Event.
It provides methods for fetching data about the event such as its id, type, actor, repo, payload, public status, and creation date.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T>
-
Constructor Summary
ConstructorsConstructorDescriptionGHEvent
(org.json.JSONObject jsonObject) Constructs a new GHEvent instance with the provided JSON object. -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObject
getActor()
Returns the actor of the event.Returns the creation date of the event.getId()
Returns the id of the event.org.json.JSONObject
Returns the payload of the event.org.json.JSONObject
getRepo()
Returns the repo of the event.getType()
Returns the type of the event.boolean
isPublic()
Returns whether the event is public.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl, toJSONObject
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
-
GHEvent
public GHEvent(org.json.JSONObject jsonObject) Constructs a new GHEvent instance with the provided JSON object.- Parameters:
jsonObject
- the JSON object containing the event data
-
-
Method Details
-
getType
Returns the type of the event.- Returns:
- the type of the event
-
getActor
public org.json.JSONObject getActor()Returns the actor of the event.- Returns:
- the actor of the event
-
getPayload
public org.json.JSONObject getPayload()Returns the payload of the event.- Returns:
- the payload of the event
-
getRepo
public org.json.JSONObject getRepo()Returns the repo of the event.- Returns:
- the repo of the event
-
getCreatedAt
Returns the creation date of the event.- Returns:
- the creation date of the event
-
getId
Returns the id of the event.- Returns:
- the id of the event
-
isPublic
public boolean isPublic()Returns whether the event is public.- Returns:
- whether the event is public
-