Interface Validated.Bound<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A value bound inside an
accumulate block, not yet
unwrapped.
Binding (Validated.Accumulator.on(Validated)) and unwrapping (value()) are separate
steps on purpose. Binding never aborts the block, it only records the error, so
every validation gets a chance to run and contribute its error before the first
unwrap of a failed binding stops the block. Bind everything first, unwrap at the end.
-
Method Summary
Modifier and TypeMethodDescriptionvalue()Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosingaccumulateblock, which then evaluates toValidated.Invalidcarrying every error accumulated so far.
-
Method Details
-
value
T value()Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosingaccumulateblock, which then evaluates toValidated.Invalidcarrying every error accumulated so far. Only legal while the surroundingaccumulatecall is on the stack.
-