Search in sources :

Example 1 with Hit

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()));
    }
}
Also used : Hit(sonia.scm.search.Hit) DisplayUser(sonia.scm.user.DisplayUser) DisplayedUserDto(com.cloudogu.scm.review.pullrequest.dto.DisplayedUserDto)

Aggregations

DisplayedUserDto (com.cloudogu.scm.review.pullrequest.dto.DisplayedUserDto)1 Hit (sonia.scm.search.Hit)1 DisplayUser (sonia.scm.user.DisplayUser)1