ListPlugins: Add support for pagination with start/limit options

Feature: Issue 6499
Change-Id: I8b6e080abbe3bd7401d505f89e71271365629c6a
This commit is contained in:
David Pursehouse
2017-07-27 17:32:28 +01:00
parent 9172702803
commit 7f577a908c
5 changed files with 127 additions and 27 deletions

View File

@@ -33,6 +33,8 @@ public interface Plugins {
abstract class ListRequest {
private boolean all;
private int limit;
private int start;
public List<PluginInfo> get() throws RestApiException {
Map<String, PluginInfo> map = getAsMap();
@@ -53,6 +55,24 @@ public interface Plugins {
public boolean getAll() {
return all;
}
public ListRequest limit(int limit) {
this.limit = limit;
return this;
}
public int getLimit() {
return limit;
}
public ListRequest start(int start) {
this.start = start;
return this;
}
public int getStart() {
return start;
}
}
/**