Package org.kohsuke.github
Class GHCompare
- java.lang.Object
-
- org.kohsuke.github.GHCompare
-
public class GHCompare extends Object
The model user for comparing 2 commits in the GitHub API.- Author:
- Michael Clarke
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHCompare.CommitCompare commits had a child commit element with additional details we want to capture.static classGHCompare.InnerCommitThe type InnerCommit.static classGHCompare.StatusThe enum Status.static classGHCompare.TreeThe type Tree.static classGHCompare.UserDeprecated.useGitUserinstead.
-
Constructor Summary
Constructors Constructor Description GHCompare()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetAheadBy()Gets ahead by.GHCompare.CommitgetBaseCommit()Gets base commit.intgetBehindBy()Gets behind by.GHCompare.Commit[]getCommits()Gets an array of commits.URLgetDiffUrl()Gets diff url.GHCommit.File[]getFiles()Gets an array of files.URLgetHtmlUrl()Gets html url.GHCompare.CommitgetMergeBaseCommit()Gets merge base commit.URLgetPatchUrl()Gets patch url.URLgetPermalinkUrl()Gets permalink url.GHCompare.StatusgetStatus()Gets status.intgetTotalCommits()Gets total commits.URLgetUrl()Gets url.PagedIterable<GHCompare.Commit>listCommits()Iterable of commits for this comparison.GHComparewrap(GHRepository owner)Deprecated.
-
-
-
Method Detail
-
getUrl
public URL getUrl()
Gets url.- Returns:
- the url
-
getHtmlUrl
public URL getHtmlUrl()
Gets html url.- Returns:
- the html url
-
getPermalinkUrl
public URL getPermalinkUrl()
Gets permalink url.- Returns:
- the permalink url
-
getDiffUrl
public URL getDiffUrl()
Gets diff url.- Returns:
- the diff url
-
getPatchUrl
public URL getPatchUrl()
Gets patch url.- Returns:
- the patch url
-
getStatus
public GHCompare.Status getStatus()
Gets status.- Returns:
- the status
-
getAheadBy
public int getAheadBy()
Gets ahead by.- Returns:
- the ahead by
-
getBehindBy
public int getBehindBy()
Gets behind by.- Returns:
- the behind by
-
getTotalCommits
public int getTotalCommits()
Gets total commits.- Returns:
- the total commits
-
getBaseCommit
public GHCompare.Commit getBaseCommit()
Gets base commit.- Returns:
- the base commit
-
getMergeBaseCommit
public GHCompare.Commit getMergeBaseCommit()
Gets merge base commit.- Returns:
- the merge base commit
-
getCommits
public GHCompare.Commit[] getCommits()
Gets an array of commits. By default, the commit list is limited to 250 results. Since 2021-03-22, compare supports pagination of commits. This makes the initialGHCompareresponse return faster and supports comparisons with more than 250 commits. To read commits progressively using pagination, setGHRepository.setCompareUsePaginatedCommits(boolean)to true before callingGHRepository.getCompare(String, String).- Returns:
- A copy of the array being stored in the class.
-
listCommits
public PagedIterable<GHCompare.Commit> listCommits()
Iterable of commits for this comparison. By default, the commit list is limited to 250 results. Since 2021-03-22, compare supports pagination of commits. This makes the initialGHCompareresponse return faster and supports comparisons with more than 250 commits. To read commits progressively using pagination, setGHRepository.setCompareUsePaginatedCommits(boolean)to true before callingGHRepository.getCompare(String, String).- Returns:
- iterable of commits
-
getFiles
public GHCommit.File[] getFiles()
Gets an array of files. By default, the file array is limited to 300 results. To retrieve the full list of files, iterate over each commit returned bylistCommits()and useGHCommit.listFiles()to get the files for each commit.- Returns:
- A copy of the array being stored in the class.
-
wrap
@Deprecated public GHCompare wrap(GHRepository owner)
Deprecated.Wrap gh compare.- Parameters:
owner- the owner- Returns:
- the gh compare
-
-