Package org.kohsuke.github
Class GHEventInfo
- java.lang.Object
-
- org.kohsuke.github.GHEventInfo
-
public class GHEventInfo extends Object
Represents an event.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHEventInfo.GHEventRepositoryInside the event JSON model, GitHub uses a slightly different format.
-
Constructor Summary
Constructors Constructor Description GHEventInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHUsergetActor()Gets actor.StringgetActorLogin()Gets actor login.DategetCreatedAt()Gets created at.longgetId()Gets id.GHOrganizationgetOrganization()Gets organization.<T extends GHEventPayload>
TgetPayload(Class<T> type)Retrieves the payload.GHRepositorygetRepository()Gets repository.GHEventgetType()Gets type.
-
-
-
Method Detail
-
getType
public GHEvent getType()
Gets type.- Returns:
- the type
-
getId
public long getId()
Gets id.- Returns:
- the id
-
getCreatedAt
public Date getCreatedAt()
Gets created at.- Returns:
- the created at
-
getRepository
public GHRepository getRepository() throws IOException
Gets repository.- Returns:
- Repository where the change was made.
- Throws:
IOException- on error
-
getActor
public GHUser getActor() throws IOException
Gets actor.- Returns:
- the
GHUseractor for this event. - Throws:
IOException- on error
-
getActorLogin
public String getActorLogin() throws IOException
Gets actor login.- Returns:
- the login of the actor.
- Throws:
IOException- on error
-
getOrganization
public GHOrganization getOrganization() throws IOException
Gets organization.- Returns:
- the organization
- Throws:
IOException- the io exception
-
getPayload
public <T extends GHEventPayload> T getPayload(Class<T> type) throws IOException
Retrieves the payload.- Type Parameters:
T- the type parameter- Parameters:
type- Specify one of theGHEventPayloadsubtype that defines a type-safe access to the payload. This must match the event type.- Returns:
- parsed event payload
- Throws:
IOException- if payload cannot be parsed
-
-