I have a code like this:
return validators
.stream()
.flatMap(v -> v.validate(scoreRequest).stream())
.collect(toList());
Each validator returns a List<String>
of errors, if the list is empty it means that the request is valid.
Now I want to introduce vavr.Validator. The new return type of each validator.validate now is Validation<List<String>,ScoreRequest>
How can I combine the output of each validators using streams like before?
,ScoreRequest>`
– Fabry Apr 16 '19 at 07:10