Class Validation.FailProjection<E,T>
java.lang.Object
fj.data.Validation.FailProjection<E,T>
- All Implemented Interfaces:
Iterable<E>
- Enclosing class:
Validation<E,T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A> Validation<A, T> apply(Validation<F<E, A>, T> v) Function application on the failing value.<A> Validation<A, T> bind(F<E, Validation<A, T>> f) Binds the given function across this validation's failing value if it has one.booleanReturnsfalseif this is a success or returns the result of the application of the given function to the failing value.Returns the failing value or fails with the given error message.Returns the failing value or fails with the given error message.<A> Option<Validation<E, A>> ReturnsNoneif this is a success or if the given predicatepdoes not hold for the failing value, otherwise, returns a fail inSome.booleanReturnstrueif this is a success or returns the result of the application of the given function to the failing value.Executes a side-effect on the failing value if there is one.voidforeachDoEffect(Effect1<E> f) Executes a side-effect on the failing value if there is one.iterator()Returns an iterator for this projection.<A> Validation<A, T> Maps the given function across the failing side of this validation.The failing value or the application of the given function to the success value.Returns the failing value or the given value.Returns the failing value or the given value.<A> Validation<A, T> sequence(Validation<A, T> v) Performs a bind across the validation, but ignores the element value in the function.toArray()Returns a single element array if this is a failing value, otherwise an empty list.toList()Returns a single element list if this is a failing value, otherwise an empty list.toOption()Returns the failing value inSomeif there is one, otherwiseNone.toStream()Returns a single element stream if this is a failing value, otherwise an empty list.Validation<E, T> Returns the underlying validation.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
v
-
-
Constructor Details
-
FailProjection
-
-
Method Details
-
validation
Returns the underlying validation.- Returns:
- The underlying validation.
-
failE
-
failE
-
orFail
-
orFail
-
on
-
foreach
-
foreachDoEffect
-
map
Maps the given function across the failing side of this validation.- Parameters:
f- The function to map.- Returns:
- A new validation with the function mapped.
-
bind
Binds the given function across this validation's failing value if it has one.- Parameters:
f- The function to bind across this validation.- Returns:
- A new validation value after binding.
-
sequence
Performs a bind across the validation, but ignores the element value in the function.- Parameters:
v- The validation value to apply in the final join.- Returns:
- A new validation value after the final join.
-
filter
ReturnsNoneif this is a success or if the given predicatepdoes not hold for the failing value, otherwise, returns a fail inSome.- Parameters:
f- The predicate function to test on this failing value.- Returns:
Noneif this is a success or if the given predicatepdoes not hold for the failing value, otherwise, returns a fail inSome.
-
apply
Function application on the failing value.- Parameters:
v- The validation of the function to apply on the failing value.- Returns:
- The result of function application in validation.
-
forall
Returnstrueif this is a success or returns the result of the application of the given function to the failing value.- Parameters:
f- The predicate function to test on this failing value.- Returns:
trueif this is a success or returns the result of the application of the given function to the failing value.
-
exists
Returnsfalseif this is a success or returns the result of the application of the given function to the failing value.- Parameters:
f- The predicate function to test on this failing value.- Returns:
falseif this is a success or returns the result of the application of the given function to the failing value.
-
toList
-
toOption
-
toArray
-
toStream
-
iterator
-