本文整理汇总了Java中org.eclipse.egit.github.core.client.PagedRequest类的典型用法代码示例。如果您正苦于以下问题:Java PagedRequest类的具体用法?Java PagedRequest怎么用?Java PagedRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PagedRequest类属于org.eclipse.egit.github.core.client包,在下文中一共展示了PagedRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: pageComments2
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
public PageIterator<ExtendedCommitComment> pageComments2(final IRepositoryIdProvider repository,
final String sha,
final int start,
final int size) {
Objects.requireNonNull(sha, "sha cannot be null");
if(sha.isEmpty()) {
throw new IllegalArgumentException("sha cannot be empty");
}
String id = this.getId(repository);
StringBuilder uri = new StringBuilder("/repos");
uri.append('/').append(id);
uri.append("/commits");
uri.append('/').append(sha);
uri.append("/comments");
PagedRequest<ExtendedCommitComment> request = createPagedRequest(start, size);
request.setUri(uri);
request.setType((new TypeToken<List<ExtendedCommitComment>>() {}).getType());
return createPageIterator(request);
}
开发者ID:aaronjwhiteside,项目名称:pipeline-github,代码行数:21,代码来源:ExtendedCommitService.java
示例2: getContextStatuses
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get statuses for commit SHA-1
*
* @param repository
* @param sha
* @return list of statuses
* @throws IOException
*/
@SneakyThrows
public List<ContextCommitStatus> getContextStatuses(IRepositoryIdProvider repository,
String sha) {
String id = getId(repository);
if (sha == null)
throw new IllegalArgumentException("SHA-1 cannot be null"); //$NON-NLS-1$
if (sha.length() == 0)
throw new IllegalArgumentException("SHA-1 cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_STATUSES);
uri.append('/').append(sha);
PagedRequest<ContextCommitStatus> request = createPagedRequest();
request.setType(new TypeToken<List<ContextCommitStatus>>() {
}.getType());
request.setUri(uri);
return getAll(request);
}
开发者ID:pivotalsoftware,项目名称:pivotal-cla,代码行数:28,代码来源:ContextCommitService.java
示例3: createPullsRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
protected PagedRequest<PullRequest> createPullsRequest(final IRepositoryIdProvider provider, final String state, final String sort, final String direction, final int start, final int size)
{
PagedRequest<PullRequest> request = createPullsRequest(provider, state, start, size);
if (sort != null && direction != null)
{
Map<String, String> params = new HashMap<String, String>(request.getParams());
if (sort != null)
{
params.put(SORT, sort);
}
if (direction != null)
{
params.put(DIRECTION, direction);
}
request.setParams(params);
}
return request;
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:22,代码来源:CustomPullRequestService.java
示例4: createUpdatedRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Overrides parent's method to change the number of items per page. This allow the update process
* to stop earlier once it encounters the first item whose updatedAt time is before lastIssueCheckTime
*
* @param repoId the repository to make the request for
* @return a list of pull requests
*/
@Override
protected PagedRequest<PullRequest> createUpdatedRequest(IRepositoryIdProvider repoId) {
PagedRequest<PullRequest> request = new PagedRequest<>(1, 30);
String path = SEGMENT_REPOS + "/" + repoId.generateId() + apiSuffix;
request.setUri(path);
request.setResponseContentType(CONTENT_TYPE_JSON);
request.setParams(createUpdatedPullRequestsParams());
request.setType(new TypeToken<PullRequest>() {
}.getType());
request.setArrayType(new TypeToken<ArrayList<PullRequest>>() {
}.getType());
return request;
}
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:23,代码来源:PullRequestUpdateService.java
示例5: getUpdatedItems
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Overrides the parent's method to remove ETags checking step and use the specialized
* method get
*
* @param repoId the repository to get the items from
* @return
*/
@Override
public ArrayList<PullRequest> getUpdatedItems(IRepositoryIdProvider repoId) {
if (updatedItems != null) {
return updatedItems;
}
ArrayList<PullRequest> result = new ArrayList<>();
String resourceDesc = repoId.generateId() + apiSuffix;
logger.info(String.format("Updating %s", resourceDesc));
try {
PagedRequest<PullRequest> request = createUpdatedRequest(repoId);
result = new ArrayList<>(getPagedItems(resourceDesc, new PageIterator<>(request, client)));
} catch (IOException e) {
logger.error(e.getLocalizedMessage(), e);
return result;
}
updatedItems = result;
return result;
}
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:29,代码来源:PullRequestUpdateService.java
示例6: getReviewComments
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Gets a pull request's review comments
*
* @param repoId
* @param pullRequestNumber
* @return list of review comments
* @throws IOException
*/
private List<ReviewComment> getReviewComments(String repoId, String pullRequestNumber)
throws IOException {
if (pullRequestNumber == null) {
throw new IllegalArgumentException("Pull request number cannot be null");
}
if (pullRequestNumber.length() == 0) {
throw new IllegalArgumentException("Pull request number cannot be empty");
}
logger.info("Getting review comments for PR" + pullRequestNumber + " " + repoId);
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(repoId)
.append(SEGMENT_PULLS)
.append('/').append(pullRequestNumber)
.append(SEGMENT_COMMENTS);
PagedRequest<ReviewComment> request = createPagedRequest();
request.setUri(uri);
request.setType(new TypeToken<List<ReviewComment>>() {
}.getType());
return getAll(request);
}
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:33,代码来源:PullRequestServiceEx.java
示例7: testHeaderIteratorInvalidRepo
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Tests that PageHeaderIterator throws a NoSuchElement exception when its next
* method is called with a initial request to an non-existent repository
*
* @throws NoSuchElementException
*/
@Test(expected = NoSuchElementException.class)
public void testHeaderIteratorInvalidRepo() throws NoSuchElementException {
GitHubClientEx client = new GitHubClientEx();
Map<String, String> params = new HashMap<>();
params.put("state", "all");
PagedRequest<Milestone> request = new PagedRequest<>();
String path = SEGMENT_REPOS + "/nonexistentrepo";
request.setUri(path);
request.setResponseContentType(CONTENT_TYPE_JSON);
request.setParams(params);
PageHeaderIterator iter = new PageHeaderIterator(request, client, "ETag");
if (iter.hasNext()) {
iter.next();
}
}
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:25,代码来源:PageHeaderIteratorTests.java
示例8: testInvalidHeadRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Tests that head request to nonexistent repo throws an exception
*
* @throws IOException
*/
@Test(expected = IOException.class)
public void testInvalidHeadRequest() throws IOException {
GitHubClientEx client = new GitHubClientEx();
PagedRequest<Milestone> request = new PagedRequest<>();
Map<String, String> params = new HashMap<>();
params.put("state", "all");
String path = SEGMENT_REPOS + "/nonexistentrepo";
request.setUri(path);
request.setResponseContentType(CONTENT_TYPE_JSON);
request.setParams(params);
client.head(request);
}
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:21,代码来源:GitHubClientExTests.java
示例9: createPullsRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Create paged request for fetching pull requests
*
* @param provider
* @param state
* @param start
* @param size
* @return paged request
*/
protected PagedRequest<PullRequest> createPullsRequest(
IRepositoryIdProvider provider, String state, int start, int size) {
final String id = getId(provider);
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_PULLS);
PagedRequest<PullRequest> request = createPagedRequest(start, size);
request.setUri(uri);
if (state != null)
request.setParams(Collections.singletonMap(
IssueService.FILTER_STATE, state));
request.setType(new TypeToken<List<PullRequest>>() {
}.getType());
return request;
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:26,代码来源:PullRequestService.java
示例10: createStarredRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Create page starred request
*
* @param user
* @param start
* @param size
* @return request
*/
protected PagedRequest<Repository> createStarredRequest(String user,
int start, int size) {
if (user == null)
throw new IllegalArgumentException("User cannot be null"); //$NON-NLS-1$
if (user.length() == 0)
throw new IllegalArgumentException("User cannot be empty"); //$NON-NLS-1$
PagedRequest<Repository> request = createPagedRequest(start, size);
StringBuilder uri = new StringBuilder(SEGMENT_USERS);
uri.append('/').append(user);
uri.append(SEGMENT_STARRED);
request.setUri(uri);
request.setType(new TypeToken<List<Repository>>() {
}.getType());
return request;
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:25,代码来源:StargazerService.java
示例11: getTeams
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get all teams in the given organization
*
* @param organization
* @return list of teams
* @throws IOException
*/
public List<Team> getTeams(String organization) throws IOException {
if (organization == null)
throw new IllegalArgumentException("Organization cannot be null"); //$NON-NLS-1$
if (organization.length() == 0)
throw new IllegalArgumentException("Organization cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_ORGS);
uri.append('/').append(organization);
uri.append(SEGMENT_TEAMS);
PagedRequest<Team> request = createPagedRequest();
request.setUri(uri);
request.setType(new TypeToken<List<Team>>() {
}.getType());
return getAll(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:23,代码来源:TeamService.java
示例12: createOrgRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Create org request
*
* @param user
* @param start
* @param size
* @return request
*/
protected PagedRequest<User> createOrgRequest(String user, int start,
int size) {
PagedRequest<User> request = new PagedRequest<User>(start, size);
if (user == null)
request.setUri(SEGMENT_USER + SEGMENT_ORGS);
else {
StringBuilder uri = new StringBuilder(SEGMENT_USERS);
uri.append('/').append(user);
uri.append(SEGMENT_ORGS);
request.setUri(uri);
}
request.setType(new TypeToken<List<User>>() {
}.getType());
return request;
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:24,代码来源:OrganizationService.java
示例13: getMembers
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get members of organization
*
* @param organization
* the name of the organization
* @param roleFilter
* only return members matching the {@link RoleFilter}<br>
* To use this feature it is currently required to set the
* {@link org.eclipse.egit.github.core.service.GitHubService#ACCEPT_PREVIEW_IRONMAN
* application/vnd.github.ironman-preview+json} Accept header in the
* {@link GitHubClient#setHeaderAccept GitHubClient}
* @return list of all organization members whose role matches the {@code roleFilter}
* @throws IOException
* @since 4.2
*/
public List<User> getMembers(String organization, RoleFilter roleFilter) throws IOException
{
if (organization == null)
throw new IllegalArgumentException("Organization cannot be null"); //$NON-NLS-1$
if (organization.length() == 0)
throw new IllegalArgumentException("Organization cannot be empty"); //$NON-NLS-1$
HashMap<String, String> params = new HashMap<String, String>();
if(roleFilter != null) params.put("role", roleFilter.toString());
StringBuilder uri = new StringBuilder(SEGMENT_ORGS);
uri.append('/').append(organization);
uri.append(SEGMENT_MEMBERS);
PagedRequest<User> request = createPagedRequest();
request.setParams(params);
request.setUri(uri);
request.setType(new TypeToken<List<User>>() {
}.getType());
return getAll(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:36,代码来源:OrganizationService.java
示例14: getPublicMembers
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get public members of organization
*
* @param organization
* @return list of public organization members
* @throws IOException
*/
public List<User> getPublicMembers(String organization) throws IOException {
if (organization == null)
throw new IllegalArgumentException("Organization cannot be null"); //$NON-NLS-1$
if (organization.length() == 0)
throw new IllegalArgumentException("Organization cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_ORGS);
uri.append('/').append(organization);
uri.append(SEGMENT_PUBLIC_MEMBERS);
PagedRequest<User> request = createPagedRequest();
request.setUri(uri);
request.setType(new TypeToken<List<User>>() {
}.getType());
return getAll(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:23,代码来源:OrganizationService.java
示例15: createWatchedRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Create page watched request
*
* @param user
* @param start
* @param size
* @return request
* @deprecated use {@link StargazerService#createStarredRequest}
*/
protected PagedRequest<Repository> createWatchedRequest(String user,
int start, int size) {
if (user == null)
throw new IllegalArgumentException("User cannot be null"); //$NON-NLS-1$
if (user.length() == 0)
throw new IllegalArgumentException("User cannot be empty"); //$NON-NLS-1$
PagedRequest<Repository> request = createPagedRequest(start, size);
StringBuilder uri = new StringBuilder(SEGMENT_USERS);
uri.append('/').append(user);
uri.append(SEGMENT_WATCHED);
request.setUri(uri);
request.setType(new TypeToken<List<Repository>>() {
}.getType());
return request;
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:26,代码来源:WatcherService.java
示例16: pageCommits
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Page commits in given repository
*
* @param repository
* @param sha
* @param path
* @param size
* @return page iterator
*/
public PageIterator<RepositoryCommit> pageCommits(
IRepositoryIdProvider repository, String sha, String path, int size) {
String id = getId(repository);
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_COMMITS);
PagedRequest<RepositoryCommit> request = createPagedRequest(PAGE_FIRST,
size);
request.setUri(uri);
request.setType(new TypeToken<List<RepositoryCommit>>() {
}.getType());
if (sha != null || path != null) {
Map<String, String> params = new HashMap<String, String>();
if (sha != null)
params.put("sha", sha); //$NON-NLS-1$
if (path != null)
params.put("path", path); //$NON-NLS-1$
request.setParams(params);
}
return createPageIterator(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:33,代码来源:CommitService.java
示例17: pageComments
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Page comments on commit with given SHA-1
*
* @param repository
* @param sha
* @param start
* @param size
* @return page iterator over comments
*/
public PageIterator<CommitComment> pageComments(
IRepositoryIdProvider repository, String sha, int start, int size) {
String id = getId(repository);
if (sha == null)
throw new IllegalArgumentException("Sha cannot be null"); //$NON-NLS-1$
if (sha.length() == 0)
throw new IllegalArgumentException("Sha cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_COMMITS);
uri.append('/').append(sha);
uri.append(SEGMENT_COMMENTS);
PagedRequest<CommitComment> request = createPagedRequest(start, size);
request.setUri(uri);
request.setType(new TypeToken<List<CommitComment>>() {
}.getType());
return createPageIterator(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:29,代码来源:CommitService.java
示例18: getStatuses
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get statuses for commit SHA-1
*
* @param repository
* @param sha
* @return list of statuses
* @throws IOException
*/
public List<CommitStatus> getStatuses(IRepositoryIdProvider repository,
String sha) throws IOException {
String id = getId(repository);
if (sha == null)
throw new IllegalArgumentException("SHA-1 cannot be null"); //$NON-NLS-1$
if (sha.length() == 0)
throw new IllegalArgumentException("SHA-1 cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_STATUSES);
uri.append('/').append(sha);
PagedRequest<CommitStatus> request = createPagedRequest();
request.setType(new TypeToken<List<CommitStatus>>() {
}.getType());
request.setUri(uri);
return getAll(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:27,代码来源:CommitService.java
示例19: createUserGistRequest
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Create user gist paged request
*
* @param user
* @param start
* @param size
* @return request
*/
protected PagedRequest<Gist> createUserGistRequest(String user, int start,
int size) {
if (user == null)
throw new IllegalArgumentException("User cannot be null"); //$NON-NLS-1$
if (user.length() == 0)
throw new IllegalArgumentException("User cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_USERS);
uri.append('/').append(user);
uri.append(SEGMENT_GISTS);
PagedRequest<Gist> request = createPagedRequest(start, size);
request.setUri(uri).setType(new TypeToken<List<Gist>>() {
}.getType());
return request;
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:24,代码来源:GistService.java
示例20: getComments
import org.eclipse.egit.github.core.client.PagedRequest; //导入依赖的package包/类
/**
* Get an issue's comments
*
* @param repository
* @param issueNumber
* @return list of comments
* @throws IOException
*/
private List<Comment> getComments(String repoId, String issueNumber)
throws IOException {
if (issueNumber == null)
throw new IllegalArgumentException("Issue number cannot be null"); //$NON-NLS-1$
if (issueNumber.length() == 0)
throw new IllegalArgumentException("Issue number cannot be empty"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(repoId);
uri.append(SEGMENT_ISSUES);
uri.append('/').append(issueNumber);
uri.append(SEGMENT_COMMENTS);
PagedRequest<Comment> request = createPagedRequest();
request.setUri(uri);
request.setType(new TypeToken<List<Comment>>() {
}.getType());
return getAll(request);
}
开发者ID:tsangiotis,项目名称:JekyllForAndroid,代码行数:27,代码来源:IssueService.java
注:本文中的org.eclipse.egit.github.core.client.PagedRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论