package github;

/**
 * Created by ndt on 9/14/15.
 */
public class PullRequestServiceEx {
}

@@ -14,80 +14,2159 @@
 b;%0A%0A
-/**%0A * Created by ndt on 9/14/15.%0A */%0Apublic class PullRequestServiceEx %7B
+import com.google.gson.reflect.TypeToken;%0Aimport org.eclipse.egit.github.core.IRepositoryIdProvider;%0Aimport org.eclipse.egit.github.core.client.PagedRequest;%0Aimport org.eclipse.egit.github.core.service.PullRequestService;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0A%0Aimport static org.eclipse.egit.github.core.client.IGitHubConstants.*;%0A%0Apublic class PullRequestServiceEx extends PullRequestService %7B%0A    /**%0A     * Gets a pull request's review comments%0A     *%0A     * @param repository%0A     * @param pullRequestNumber%0A     * @return list of review comments%0A     * @throws IOException%0A     */%0A    public List%3CReviewComment%3E getReviewComments(IRepositoryIdProvider repository,%0A                                                 int pullRequestNumber) throws IOException %7B%0A        return getReviewComments(repository, Integer.toString(pullRequestNumber));%0A    %7D%0A%0A    /**%0A     * Gets a pull request's review comments%0A     *%0A     * @param repository%0A     * @param pullRequestNumber%0A     * @return list of review comments%0A     * @throws IOException%0A     */%0A    public List%3CReviewComment%3E getReviewComments(IRepositoryIdProvider repository,%0A                                                 String pullRequestNumber) throws IOException %7B%0A        String repoId = getId(repository);%0A        return getReviewComments(repoId, pullRequestNumber);%0A    %7D%0A%0A    /**%0A     * Gets a pull request's review comments%0A     *%0A     * @param repoId%0A     * @param pullRequestNumber%0A     * @return list of review comments%0A     * @throws IOException%0A     */%0A    private List%3CReviewComment%3E getReviewComments(String repoId, String pullRequestNumber)%0A            throws IOException %7B%0A        StringBuilder uri = new StringBuilder(SEGMENT_REPOS);%0A        uri.append('/').append(repoId);%0A        uri.append(SEGMENT_PULLS);%0A        uri.append('/').append(pullRequestNumber);%0A        uri.append(SEGMENT_COMMENTS);%0A%0A        PagedRequest%3CReviewComment%3E request = createPagedRequest();%0A        request.setUri(uri);%0A        request.setType(new TypeToken%3CList%3CReviewComment%3E%3E() %7B%0A        %7D.getType());%0A%0A        System.out.println(request.getUri());%0A%0A        return getAll(request);%0A    %7D
 %0A%7D%0A

Create PullRequestServiceEx