mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
add content and order parameters to GHContentSearchBuilder as per #1088
This commit is contained in:
@@ -118,7 +118,36 @@ public class GHContentSearchBuilder extends GHSearchBuilder<GHContent> {
|
||||
return q("repo:" + v);
|
||||
}
|
||||
|
||||
private static class ContentSearchResult extends SearchResult<GHContent> {
|
||||
/**
|
||||
* Order gh content search builder.
|
||||
*
|
||||
* @param v the v
|
||||
* @return the gh content search builder
|
||||
*/
|
||||
public GHContentSearchBuilder order(GHDirection v) {
|
||||
req.with("order", v);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort gh content search builder.
|
||||
*
|
||||
* @param sort the sort
|
||||
* @return the gh content search builder
|
||||
*/
|
||||
public GHContentSearchBuilder sort(GHContentSearchBuilder.Sort sort) {
|
||||
req.with("sort", sort);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The enum Sort.
|
||||
*/
|
||||
public enum Sort {
|
||||
INDEXED
|
||||
}
|
||||
|
||||
private static class ContentSearchResult extends SearchResult<GHContent> {
|
||||
private GHContent[] items;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,6 +100,8 @@ public class GitHubTest extends AbstractGitHubWireMockTest {
|
||||
.in("file")
|
||||
.language("js")
|
||||
.repo("jquery/jquery")
|
||||
.sort(GHContentSearchBuilder.Sort.INDEXED)
|
||||
.order(GHDirection.ASC)
|
||||
.list();
|
||||
GHContent c = r.iterator().next();
|
||||
// System.out.println(c.getName());
|
||||
|
||||
Reference in New Issue
Block a user