0
With the following code:
public void deleteOrSave() {
Mono.just("someName")
.filter(this::isMyName)
.flatMap(this::delete)
.orElse(this::save);
}
private boolean isMyName(String name) {
return false;
}
private Mono<Void> delete(String name) {
return Mono.empty();
}
private Mono<Void> save(String name) {
return Mono.empty();
}
This orelse is not possible (nor orElseGet), but I would like to implement something similar. Where I have a Mono, filter and if true, I call one method, if not, call another. This is possible ?