Open
Description
This pattern kind of gets old:
return Mono.zip(selfLink, aggregateLink, addLink, deleteLink) //
.map(links -> Links.of(links.getT1(), links.getT2(), links.getT3(), links.getT4()))
.flatMap(links -> this.repository.findById(id) //
.map(item -> new EntityModel<>(item, links)));
The first two lines are Reactor boilerplate to take several WebMvcLinkBuild.linkTo....toMono()
calls and chain them together into a Mono<Links>
object.
If we had a utility method(s), then this could be vastly simplified.