aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-10-10 16:13:18 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-10-12 12:24:32 +0200
commit93b2b3e9029564ece6f9b1a520a6427ff1f5b645 (patch)
treed36ac05bdef8a5a8c8a529cb9f5fe9ee43697952 /sonar-plugin-api
parent5c3ef618f8da331b486a958714a4cf709e80a04d (diff)
downloadsonarqube-93b2b3e9029564ece6f9b1a520a6427ff1f5b645.tar.gz
sonarqube-93b2b3e9029564ece6f9b1a520a6427ff1f5b645.zip
SONAR-8206 add WS api/root/search
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/user/UserQuery.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/user/UserQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/user/UserQuery.java
index 76a3c0fef59..136e16a1f39 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/user/UserQuery.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/user/UserQuery.java
@@ -36,6 +36,7 @@ public class UserQuery {
private final Collection<String> logins;
private final boolean includeDeactivated;
private final String searchText;
+ private final Boolean mustBeRoot;
// for internal use in MyBatis
final String searchTextSql;
@@ -44,6 +45,7 @@ public class UserQuery {
this.logins = builder.logins;
this.includeDeactivated = builder.includeDeactivated;
this.searchText = builder.searchText;
+ this.mustBeRoot = builder.mustBeRoot;
this.searchTextSql = searchTextToSql(searchText);
}
@@ -75,6 +77,11 @@ public class UserQuery {
return searchText;
}
+ @CheckForNull
+ public Boolean mustBeRoot() {
+ return mustBeRoot;
+ }
+
public static Builder builder() {
return new Builder();
}
@@ -83,6 +90,7 @@ public class UserQuery {
private boolean includeDeactivated = false;
private Collection<String> logins;
private String searchText;
+ private Boolean mustBeRoot;
private Builder() {
}
@@ -108,6 +116,16 @@ public class UserQuery {
return this;
}
+ public Builder mustBeRoot() {
+ this.mustBeRoot = true;
+ return this;
+ }
+
+ public Builder mustNotBeRoot() {
+ this.mustBeRoot = false;
+ return this;
+ }
+
public UserQuery build() {
if (logins != null && logins.size() >= 1000) {
throw new IllegalArgumentException("Max number of logins is 1000. Got " + logins.size());