Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.29 KB

validate-and-fail-fast-for-any.adoc

File metadata and controls

50 lines (40 loc) · 1.29 KB

validateAndFailFastForAny

This execution strategy lets you run validations for your batch data structure and fails-fast on the first failure for any member in the batch i.e., if a member fails one of the validations, it stops running further validations on the rest of the members in the batch.

Params

Param Data type Required? Description

validatables

List<ValidatableT>

Yes

List of POJO/Beans under validation

batchValidationConfig

BatchValidationConfig

Yes

Config for validation

failureForNullValidatable

FailureT

No

Failure to return if a member in validatables passed is null

throwableMapper

(Throwable) → FailureT?

No

Refer this section

Return

Optional<FailureT> - First failure for any member. If all members pass all validations, Optional.empty() shall be returned.