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