Interface Validated.Bound<T>

Enclosing interface:
Validated<E,T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Validated.Bound<T>
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 Type
    Method
    Description
    Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosing accumulate block, which then evaluates to Validated.Invalid carrying every error accumulated so far.
  • Method Details

    • value

      T value()
      Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosing accumulate block, which then evaluates to Validated.Invalid carrying every error accumulated so far. Only legal while the surrounding accumulate call is on the stack.