Search in sources :

Example 1 with RestReadView

use of com.google.gerrit.extensions.restapi.RestReadView in project gerrit by GerritCodeReview.

the class StarredChanges method list.

@Override
public RestView<AccountResource> list() throws ResourceNotFoundException {
    return new RestReadView<AccountResource>() {

        @Override
        public Object apply(AccountResource self) throws BadRequestException, AuthException, OrmException {
            QueryChanges query = changes.list();
            query.addQuery("starredby:" + self.getUser().getAccountId().get());
            return query.apply(TopLevelResource.INSTANCE);
        }
    };
}
Also used : RestReadView(com.google.gerrit.extensions.restapi.RestReadView) QueryChanges(com.google.gerrit.server.query.change.QueryChanges)

Aggregations

RestReadView (com.google.gerrit.extensions.restapi.RestReadView)1 QueryChanges (com.google.gerrit.server.query.change.QueryChanges)1