Interface Validation<E,T>

Type Parameters:
E - type of the error when invalid
T - type of the value when valid
All Superinterfaces:
Bindable<Validation<E,?>,T>, Kind<Validation<E,?>,T>, Mappable<Validation<E,?>,T>, ValidationOf<E,T>
All Known Implementing Classes:
Validation.Invalid, Validation.Valid

public sealed interface Validation<E,T> extends ValidationOf<E,T>, Bindable<Validation<E,?>,T> permits Validation.Valid<E,T>, Validation.Invalid<E,T>

This type represents the validity or not of a value. There are two possible values:

  • Validation.valid(value): when the value is valid
  • Validation.invalid(error): when the value is invalid

You can combine different values using mapN methods. Only when all values are valid, the final method is invoked, otherwise a combination of all errors is returned