use of com.google.gerrit.server.restapi.change.ListChangeComments in project gerrit by GerritCodeReview.
the class ChangeApiImpl method commentsRequest.
@Override
public CommentsRequest commentsRequest() {
return new CommentsRequest() {
@Override
public Map<String, List<CommentInfo>> get() throws RestApiException {
try {
ListChangeComments listComments = listCommentsProvider.get();
listComments.setContext(this.getContext());
listComments.setContextPadding(this.getContextPadding());
return listComments.apply(change).value();
} catch (Exception e) {
throw asRestApiException("Cannot get comments", e);
}
}
@Override
public List<CommentInfo> getAsList() throws RestApiException {
try {
ListChangeComments listComments = listCommentsProvider.get();
listComments.setContext(this.getContext());
listComments.setContextPadding(this.getContextPadding());
return listComments.getComments(change);
} catch (Exception e) {
throw asRestApiException("Cannot get comments", e);
}
}
};
}
Aggregations