FlowingCode / backend-core

Commons utilities for back-end enterprise features
Apache License 2.0
4 stars 1 forks source link

Improve call for "all validators pass" #101

Open javier-godoy opened 5 days ago

javier-godoy commented 5 days ago

If I want to test whether all validators pass, I have to write

service.getValidators(DeletionValidator.class).stream().allMatch(v -> v.validate(dto).isEmpty())

It should be something shorter, maybe

service.test(DeletionValidator.class, dto)