use of com.google.gerrit.server.query.change.ChangeQueryBuilder in project gerrit by GerritCodeReview.
the class ProjectWatch method filterMatch.
private boolean filterMatch(CurrentUser user, String filter) throws QueryParseException {
ChangeQueryBuilder qb;
Predicate<ChangeData> p = null;
if (user == null) {
qb = args.queryBuilder.get().asUser(args.anonymousUser.get());
} else {
qb = args.queryBuilder.get().asUser(user);
p = qb.isVisible();
}
if (filter != null) {
Predicate<ChangeData> filterPredicate = qb.parse(filter);
if (p == null) {
p = filterPredicate;
} else {
p = Predicate.and(filterPredicate, p);
}
}
return p == null || p.asMatchable().match(changeData);
}
Aggregations