use of com.google.gerrit.extensions.api.projects.CommentLinkInput in project gerrit by GerritCodeReview.
the class PutConfig method updateCommentLinks.
private void updateCommentLinks(ProjectConfig projectConfig, Map<String, CommentLinkInput> input) {
for (Map.Entry<String, CommentLinkInput> e : input.entrySet()) {
String name = e.getKey();
CommentLinkInput value = e.getValue();
if (value != null) {
// Add or update the commentlink section
Config cfg = new Config();
cfg.setString(COMMENTLINK, name, KEY_MATCH, value.match);
cfg.setString(COMMENTLINK, name, KEY_LINK, value.link);
cfg.setBoolean(COMMENTLINK, name, KEY_ENABLED, value.enabled == null || value.enabled);
projectConfig.addCommentLinkSection(ProjectConfig.buildCommentLink(cfg, name, false));
} else {
// Delete the commentlink section
projectConfig.removeCommentLinkSection(name);
}
}
}
use of com.google.gerrit.extensions.api.projects.CommentLinkInput in project gerrit by GerritCodeReview.
the class ProjectIT method addCommentLink.
private void addCommentLink(ConfigInput configInput, String name, String match, String link) {
CommentLinkInput commentLinkInput = new CommentLinkInput();
commentLinkInput.match = match;
commentLinkInput.link = link;
addCommentLink(configInput, name, commentLinkInput);
}
Aggregations