Invalid<E, A> class final

A Validated that represents a failure, or invalid value.

Inheritance
Available extensions

Constructors

Invalid(E value)

Properties

hashCode int
The hash code for this object.
no setterinherited
isInvalid bool
Returns true if this instance is an Invalid, otherwise false is returned.
no setterinherited
isValid bool
Returns true if this instance is a Valid, otherwise false is returned.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → E
final

Methods

andThen<B>(Function1<A, Validated<E, B>> f) Validated<E, B>
Creates a new Validated by applying f if this is a Valid, otherwise returns the error value.
inherited
ap<B>(ValidatedNel<E, Function1<A, B>> f) ValidatedNel<E, B>

Available on ValidatedNel<E, A>, provided by the ValidatedNelOps extension

Applies f to this value if both instance are Valid. Otherwise returns the error if either is Invalid or the accumulation of errors if both are Invalid.
bimap<EE, AA>(Function1<E, EE> fe, Function1<A, AA> fa) Validated<EE, AA>
Returns a new Validated by applying fe or fa depending on if this instance is an Invalid or Valid respectively.
inherited
ensure(Function1<A, bool> p, Function0<E> onFailure) Validated<E, A>
Tests if the valid value (if any) passes the given predicate p. If it fails, a new Invalid with a value of onFailure is returned, otherwise this instance is returned.
inherited
ensureOr(Function1<A, bool> p, Function1<A, E> onFailure) Validated<E, A>
Tests if the valid value (if any) passes the given predicate p. If it fails, a new Invalid with a value of onFailure is returned, otherwise this instance is returned.
inherited
exists(Function1<A, bool> p) bool
Returns true if this instance has a valid value to pass the given predicate p.
inherited
flatten() Validated<E, A>

Available on Validated<E, Validated<E, A>>, provided by the ValidatedNestedOps extension

Extracts the nested Validated via fold.
fold<B>(Function1<E, B> fe, Function1<A, B> fa) → B
Returns the result of applying fe if this is an instance of Invalid, otherwise the result of applying fa to this Valid.
override
forall(Function1<A, bool> p) bool
Returns true if this instance has a valid value to pass the given predicate p.
inherited
foreach(Function1<A, void> f) → void
Applies the given side-effect f for every valid value this instance represents.
inherited
getOrElse(Function0<A> orElse) → A
Returns the value of this instance if it is a Valid, otherwise returns the result of evaluating orElse.
inherited
leftMap<EE>(Function1<E, EE> f) Validated<EE, A>
Returns a new validated by applying f to the value of this instance if it is an Invalid.
inherited
map<B>(Function1<A, B> f) Validated<E, B>
Returns a new validated by applying f to the value of this instance if it is a Valid.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orElse(Function0<Validated<E, A>> orElse) Validated<E, A>
If this instance is a Valid, this is returned. Otherwise, the result of evaluating orElse is returned.
inherited
product<B>(ValidatedNel<E, B> that) ValidatedNel<E, (A, B)>

Available on ValidatedNel<E, A>, provided by the ValidatedNelOps extension

Returns the product (tuple) of this validation and that if both instances are Valid. Otherwise returns the error if either is Invalid or the accumulation of errors if both are Invalid.
swap() Validated<A, E>
Returns a new Validated where the invalid and valid types are swapped.
inherited
toEither() Either<E, A>
Returns a new Either where the left and right types correspond to the invalid and valid types respectively.
inherited
toIList() IList<A>
Returns a new IList with the valid value of this instance, if any. If this instance is Invalid, an empty IList is returned.
inherited
toOption() Option<A>
Returns None if this instance is an Invalid, otherwise a Some with the valid value.
inherited
toString() String
A string representation of this object.
inherited
toValidatedNel() ValidatedNel<E, A>
Converts this instance to a ValidatedNel.
inherited
valueOr(Function1<E, A> f) → A
Alias for fold.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited