use of com.b2international.index.revision.CommitDetail in project snow-owl by b2ihealthcare.
the class CommitInfoConverter method toResource.
@Override
protected CommitInfo toResource(final Commit doc) {
final Builder builder = CommitInfo.builder(doc);
// expand details if requested
if (expand().containsKey(CommitInfo.Expand.DETAILS)) {
final Options detailsExpandOptions = expand().get(CommitInfo.Expand.DETAILS, Options.class);
final Collection<CommitDetail> commitDetails = getCommitDetails(doc, detailsExpandOptions);
final List<CommitInfoDetail> commitInfoDetails = commitDetails.stream().flatMap(info -> toCommitInfoDetail(info)).collect(Collectors.toList());
builder.details(new CommitInfoDetails(commitInfoDetails, null, commitInfoDetails.size(), commitInfoDetails.size()));
}
return builder.build();
}
Aggregations