Interface Validated.Accumulator<E>
public static interface Validated.Accumulator<E>
The binding handle passed to
Validated.accumulate(Function).-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCheck a condition with no value to bind: a guard, a limit, a cross-field rule.default <T> Validated.Bound<T> Bind aResult:Erraccumulates as a single error.<T> Validated.Bound<T> Bind aValidated: aValid's value becomes available viaValidated.Bound.value(); anInvalid's errors are added to the accumulator.default <T> Validated.Bound<T> Bind anOptional: empty accumulatesifEmpty.get().default <T,R> Validated.Bound <List<R>> Bind a validation of every element of a list (onof atraverse): every failing element contributes its errors, and theValidated.Boundyields the fully-parsed list.
-
Method Details
-
on
Bind aValidated: aValid's value becomes available viaValidated.Bound.value(); anInvalid's errors are added to the accumulator. Binding never aborts the block; later validations still run. -
on
Bind aResult:Erraccumulates as a single error. -
on
Bind anOptional: empty accumulatesifEmpty.get(). -
onEach
default <T,R> Validated.Bound<List<R>> onEach(List<? extends T> items, Function<? super T, ? extends Validated<E, R>> parse) Bind a validation of every element of a list (onof atraverse): every failing element contributes its errors, and theValidated.Boundyields the fully-parsed list. -
ensure
-