Search in sources :

Example 1 with RobotCommentResource

use of com.google.gerrit.server.change.RobotCommentResource in project gerrit by GerritCodeReview.

the class RobotComments method parse.

@Override
public RobotCommentResource parse(RevisionResource rev, IdString id) throws ResourceNotFoundException {
    String uuid = id.get();
    ChangeNotes notes = rev.getNotes();
    for (RobotComment c : commentsUtil.robotCommentsByPatchSet(notes, rev.getPatchSet().id())) {
        if (uuid.equals(c.key.uuid)) {
            return new RobotCommentResource(rev, c);
        }
    }
    throw new ResourceNotFoundException(id);
}
Also used : RobotComment(com.google.gerrit.entities.RobotComment) RobotCommentResource(com.google.gerrit.server.change.RobotCommentResource) IdString(com.google.gerrit.extensions.restapi.IdString) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException)

Aggregations

RobotComment (com.google.gerrit.entities.RobotComment)1 IdString (com.google.gerrit.extensions.restapi.IdString)1 ResourceNotFoundException (com.google.gerrit.extensions.restapi.ResourceNotFoundException)1 RobotCommentResource (com.google.gerrit.server.change.RobotCommentResource)1 ChangeNotes (com.google.gerrit.server.notedb.ChangeNotes)1