use of sonia.scm.search.Hit in project scm-review-plugin by scm-manager.
the class HitEnricher method appendEmbeddedUserForAuthor.
private void appendEmbeddedUserForAuthor(HalAppender appender, Hit hit) {
Hit.Field author = hit.getFields().get("author");
Optional<DisplayUser> displayUser = userDisplayManager.get(((Hit.ValueField) author).getValue().toString());
if (displayUser.isPresent()) {
DisplayUser user = displayUser.get();
appender.appendEmbedded("user", new DisplayedUserDto(user.getId(), user.getDisplayName(), user.getMail()));
}
}
Aggregations