diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/projects/Projects.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/projects/Projects.java index a0f22b90b8..02351cd241 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/projects/Projects.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/projects/Projects.java @@ -14,12 +14,67 @@ package com.google.gerrit.extensions.api.projects; +import com.google.gerrit.extensions.common.ProjectInfo; import com.google.gerrit.extensions.restapi.NotImplementedException; import com.google.gerrit.extensions.restapi.RestApiException; +import java.util.List; + public interface Projects { ProjectApi name(String name) throws RestApiException; + List list() throws RestApiException; + List list(ListParameter listParameter) throws RestApiException; + + public class ListParameter { + private boolean description; + private String prefix; + private int limit; + private int start; + + public ListParameter() {} + + public ListParameter(String prefix) { + this.prefix = prefix; + } + + public ListParameter withDescription(boolean description) { + this.description = description; + return this; + } + + public ListParameter withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + public ListParameter withLimit(int limit) { + this.limit = limit; + return this; + } + + public ListParameter withStart(int start) { + this.start = start; + return this; + } + + public boolean getDescription() { + return description; + } + + public String getPrefix() { + return prefix; + } + + public int getLimit() { + return limit; + } + + public int getStart() { + return start; + } + } + /** * A default implementation which allows source compatibility * when adding new methods to the interface. @@ -29,5 +84,15 @@ public interface Projects { public ProjectApi name(String name) throws RestApiException { throw new NotImplementedException(); } + + @Override + public List list() throws RestApiException { + throw new NotImplementedException(); + } + + @Override + public List list(ListParameter listParameter) throws RestApiException { + throw new NotImplementedException(); + } } }