Package org.kohsuke.github
Class GHObject
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- Direct Known Subclasses:
GHApp,GHAppInstallation,GHAsset,GHAuthorization,GHCheckRun,GHCheckSuite,GHCommitComment,GHCommitStatus,GHDeployment,GHDeploymentStatus,GHGist,GHHook,GHInvitation,GHIssue,GHIssueComment,GHLicense,GHMilestone,GHPerson,GHProject,GHProjectCard,GHProjectColumn,GHPullRequestReview,GHPullRequestReviewComment,GHReaction,GHRelease,GHRepository,GHRepositoryStatistics.CommitActivity,GHRepositoryStatistics.ContributorStats,GHRepositoryStatistics.Participation,GHRequestedAction,GHTeam,GHThread
public abstract class GHObject extends Object
Most (all?) domain objects in GitHub seems to have these 4 properties.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<String>>responseHeaderFieldsCapture response HTTP headers on the state object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DategetCreatedAt()When was this resource created?abstract URLgetHtmlUrl()Gets html url.longgetId()Gets id.StringgetNodeId()Get Global node_id from Github object.Map<String,List<String>>getResponseHeaderFields()Deprecated.DategetUpdatedAt()When was this resource last updated?URLgetUrl()Gets url.protected voidsetResponseHeaderFields(org.kohsuke.github.GitHubResponse.ResponseInfo responseInfo)Called by JacksonStringtoString()String representation to assist debugging and inspection.
-
-
-
Method Detail
-
setResponseHeaderFields
protected void setResponseHeaderFields(@CheckForNull org.kohsuke.github.GitHubResponse.ResponseInfo responseInfo)
Called by Jackson- Parameters:
responseInfo- theGitHubResponse.ResponseInfoto get headers from.
-
getResponseHeaderFields
@CheckForNull @Deprecated public Map<String,List<String>> getResponseHeaderFields()
Deprecated.Returns the HTTP response headers given along with the state of this object.Some of the HTTP headers have nothing to do with the object, for example "Cache-Control" and others are different depending on how this object was retrieved.
This method was added as a kind of hack to allow the caller to retrieve OAuth scopes and such. Use with caution. The method might be removed in the future.
- Returns:
- a map of header names to value lists
-
getCreatedAt
@WithBridgeMethods(value=java.lang.String.class, adapterMethod="createdAtStr") public Date getCreatedAt() throws IOException
When was this resource created?- Returns:
- date created
- Throws:
IOException- on error
-
getUrl
@WithBridgeMethods(value=java.lang.String.class, adapterMethod="urlToString") public URL getUrl()
Gets url.- Returns:
- API URL of this object.
-
getHtmlUrl
@WithBridgeMethods(value=java.lang.String.class, adapterMethod="urlToString") public abstract URL getHtmlUrl() throws IOException
Gets html url.- Returns:
- URL of this object for humans, which renders some HTML.
- Throws:
IOException- on error
-
getUpdatedAt
public Date getUpdatedAt() throws IOException
When was this resource last updated?- Returns:
- updated date
- Throws:
IOException- on error
-
getNodeId
public String getNodeId()
Get Global node_id from Github object.- Returns:
- Global Node ID.
- See Also:
- Using Global Node IDs
-
getId
@WithBridgeMethods(value={java.lang.String.class,int.class}, adapterMethod="longToStringOrInt") public long getId()Gets id.- Returns:
- Unique ID number of this resource.
-
-