final case class Failure[E](e: E) extends Validation[E, Nothing] with Product with Serializable
- Source
- Validation.scala
- Alphabetic
- By Inheritance
- Failure
- Validation
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Failure(e: E)
Type Members
-
final
class
SwitchingValidation[X] extends AnyRef
- Definition Classes
- Validation
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+++[EE >: E, AA >: Nothing](x: ⇒ Validation[EE, AA])(implicit M1: Semigroup[AA], M2: Semigroup[EE]): Validation[EE, AA]
Sums up values inside validation, if both are success or failure.
Sums up values inside validation, if both are success or failure. Returns first failure otherwise.
success(v1) +++ success(v2) → success(v1 + v2) success(v1) +++ failure(v2) → failure(v2) failure(v1) +++ success(v2) → failure(v1) failure(v1) +++ failure(v2) → failure(v1 + v2)
- Definition Classes
- Validation
-
def
+|+[EE >: E, AA >: Nothing](x: Validation[EE, AA])(implicit es: Semigroup[EE], as: Semigroup[AA]): Validation[EE, AA]
If
this
andthat
are both success, or both a failure, combine them with the providedSemigroup
for each.If
this
andthat
are both success, or both a failure, combine them with the providedSemigroup
for each. Otherwise, return the success. Alias forappend
- Definition Classes
- Validation
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
===[EE >: E, AA >: Nothing](x: Validation[EE, AA])(implicit EE: Equal[EE], EA: Equal[AA]): Boolean
Compare two validations values for equality.
Compare two validations values for equality.
- Definition Classes
- Validation
-
def
@\/[EE, AA](k: (\/[E, Nothing]) ⇒ \/[EE, AA]): Validation[EE, AA]
Run a disjunction function and back to validation again.
Run a disjunction function and back to validation again. Alias for
disjunctioned
- Definition Classes
- Validation
-
def
ap[EE >: E, B](x: ⇒ Validation[EE, (Nothing) ⇒ B])(implicit E: Semigroup[EE]): Validation[EE, B]
Apply a function in the environment of the success of this validation, accumulating errors.
Apply a function in the environment of the success of this validation, accumulating errors.
- Definition Classes
- Validation
-
def
append[EE >: E, AA >: Nothing](that: Validation[EE, AA])(implicit es: Semigroup[EE], as: Semigroup[AA]): Validation[EE, AA]
If
this
andthat
are both success, or both a failure, combine them with the providedSemigroup
for each.If
this
andthat
are both success, or both a failure, combine them with the providedSemigroup
for each. Otherwise, return the success. Alias for+|+
- Definition Classes
- Validation
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bimap[C, D](f: (E) ⇒ C, g: (Nothing) ⇒ D): Validation[C, D]
Binary functor map on this validation.
Binary functor map on this validation.
- Definition Classes
- Validation
-
def
bitraverse[G[_], C, D](f: (E) ⇒ G[C], g: (Nothing) ⇒ G[D])(implicit arg0: Functor[G]): G[Validation[C, D]]
Binary functor traverse on this validation.
Binary functor traverse on this validation.
- Definition Classes
- Validation
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
compare[EE >: E, AA >: Nothing](x: Validation[EE, AA])(implicit EE: Order[EE], EA: Order[AA]): Ordering
Compare two validations values for ordering.
Compare two validations values for ordering.
- Definition Classes
- Validation
-
def
disjunction: \/[E, Nothing]
Convert to a disjunction.
Convert to a disjunction.
- Definition Classes
- Validation
-
def
disjunctioned[EE, AA](k: (\/[E, Nothing]) ⇒ \/[EE, AA]): Validation[EE, AA]
Run a disjunction function and back to validation again.
Run a disjunction function and back to validation again. Alias for
@\/
- Definition Classes
- Validation
- val e: E
-
def
ensure[EE >: E](onFailure: ⇒ EE)(f: (Nothing) ⇒ Boolean): Validation[EE, Nothing]
Ensures that the success value of this validation satisfies the given predicate, or fails with the given value.
Ensures that the success value of this validation satisfies the given predicate, or fails with the given value.
- Definition Classes
- Validation
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
excepting[EE >: E](pf: PartialFunction[Nothing, EE]): Validation[EE, Nothing]
Return a Validation formed by the application of a partial function across the success of this value:
Return a Validation formed by the application of a partial function across the success of this value:
strings map (_.parseInt excepting { case i if i < 0 => new Exception(s"Int must be positive: $i") })
- Definition Classes
- Validation
- Since
7.0.2
-
def
exists(f: (Nothing) ⇒ Boolean): Boolean
Return
true
if this validation is a success value satisfying the given predicate.Return
true
if this validation is a success value satisfying the given predicate.- Definition Classes
- Validation
-
def
filter[EE >: E](p: (Nothing) ⇒ Boolean)(implicit M: Monoid[EE]): Validation[EE, Nothing]
Filter on the success of this validation.
Filter on the success of this validation.
- Definition Classes
- Validation
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findSuccess[EE >: E, AA >: Nothing](that: ⇒ Validation[EE, AA])(implicit es: Semigroup[EE]): Validation[EE, AA]
If
this
is a success, return it; otherwise, ifthat
is a success, return it; otherwise, combine the failures with the specified semigroup.If
this
is a success, return it; otherwise, ifthat
is a success, return it; otherwise, combine the failures with the specified semigroup.- Definition Classes
- Validation
-
def
fold[X](fail: (E) ⇒ X, succ: (Nothing) ⇒ X): X
Catamorphism.
Catamorphism. Run the first given function if failure, otherwise, the second given function.
- Definition Classes
- Validation
-
def
foldConst[X](fail: ⇒ X, success: ⇒ X): X
If this validation is success, return
success
, otherwise, returnfail
.If this validation is success, return
success
, otherwise, returnfail
.- Definition Classes
- Validation
-
def
foldRight[B](z: ⇒ B)(f: (Nothing, ⇒ B) ⇒ B): B
Fold on the success of this validation.
Fold on the success of this validation.
- Definition Classes
- Validation
-
def
forall(f: (Nothing) ⇒ Boolean): Boolean
Return
true
if this validation is a failure value or the success value satisfies the given predicate.Return
true
if this validation is a failure value or the success value satisfies the given predicate.- Definition Classes
- Validation
-
def
foreach(f: (Nothing) ⇒ Unit): Unit
Run the side-effect on the success of this validation.
Run the side-effect on the success of this validation.
- Definition Classes
- Validation
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getOrElse[AA >: Nothing](x: ⇒ AA): AA
Return the success value of this validation or the given default if failure.
Return the success value of this validation or the given default if failure. Alias for
|
- Definition Classes
- Validation
-
def
isFailure: Boolean
Return
true
if this validation is failure.Return
true
if this validation is failure.- Definition Classes
- Validation
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSuccess: Boolean
Return
true
if this validation is success.Return
true
if this validation is success.- Definition Classes
- Validation
-
def
leftMap[C](f: (E) ⇒ C): Validation[C, Nothing]
Run the given function on the left value.
Run the given function on the left value.
- Definition Classes
- Validation
-
def
loopFailure[EE >: E, AA >: Nothing, X](success: (AA) ⇒ X, failure: (EE) ⇒ \/[X, Validation[EE, AA]]): X
Spin in tail-position on the failure value of this validation.
Spin in tail-position on the failure value of this validation.
- Definition Classes
- Validation
-
def
loopSuccess[EE >: E, AA >: Nothing, X](success: (AA) ⇒ \/[X, Validation[EE, AA]], failure: (EE) ⇒ X): X
Spin in tail-position on the success value of this validation.
Spin in tail-position on the success value of this validation.
- Definition Classes
- Validation
-
def
map[B](f: (Nothing) ⇒ B): Validation[E, B]
Map on the success of this validation.
Map on the success of this validation.
- Definition Classes
- Validation
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
orElse[EE >: E, AA >: Nothing](x: ⇒ Validation[EE, AA]): Validation[EE, AA]
Return this if it is a success, otherwise, return the given value.
Return this if it is a success, otherwise, return the given value. Alias for
|||
- Definition Classes
- Validation
-
def
show[EE >: E, AA >: Nothing](implicit SE: Show[EE], SA: Show[AA]): Cord
Show for a validation value.
Show for a validation value.
- Definition Classes
- Validation
-
def
swap: Validation[Nothing, E]
Flip the failure/success values in this validation.
Flip the failure/success values in this validation. Alias for
unary_~
- Definition Classes
- Validation
-
def
swapped[EE, AA](k: (Validation[Nothing, E]) ⇒ Validation[AA, EE]): Validation[EE, AA]
Run the given function on this swapped value.
Run the given function on this swapped value. Alias for
~
- Definition Classes
- Validation
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toEither: Either[E, Nothing]
Convert to a core
scala.Either
at your own peril.Convert to a core
scala.Either
at your own peril.- Definition Classes
- Validation
-
def
toIList[AA >: Nothing]: IList[AA]
Return an empty ilist or an ilist with one element on the success of this validation.
Return an empty ilist or an ilist with one element on the success of this validation.
- Definition Classes
- Validation
-
def
toList: List[Nothing]
Return an empty list or a list with one element on the success of this validation.
Return an empty list or a list with one element on the success of this validation.
- Definition Classes
- Validation
-
def
toMaybe[AA >: Nothing]: Maybe[AA]
Return an empty maybe or maybe with the element on the success of this validation.
Return an empty maybe or maybe with the element on the success of this validation. Useful to sweep errors under the carpet.
- Definition Classes
- Validation
-
def
toOption: Option[Nothing]
Return an empty option or option with one element on the success of this validation.
Return an empty option or option with one element on the success of this validation. Useful to sweep errors under the carpet.
- Definition Classes
- Validation
-
def
toStream: Stream[Nothing]
Return an empty stream or stream with one element on the success of this validation.
Return an empty stream or stream with one element on the success of this validation.
- Definition Classes
- Validation
-
def
toValidationNel[EE >: E, AA >: Nothing]: ValidationNel[EE, AA]
Wraps the failure value in a scalaz.NonEmptyList
Wraps the failure value in a scalaz.NonEmptyList
- Definition Classes
- Validation
-
def
traverse[G[_], EE >: E, B](f: (Nothing) ⇒ G[B])(implicit arg0: Applicative[G]): G[Validation[EE, B]]
Traverse on the success of this validation.
Traverse on the success of this validation.
- Definition Classes
- Validation
-
def
unary_~: Validation[Nothing, E]
Flip the failure/success values in this validation.
Flip the failure/success values in this validation. Alias for
swap
- Definition Classes
- Validation
-
def
valueOr[AA >: Nothing](x: (E) ⇒ AA): AA
Return the success value of this validation or run the given function on the failure.
Return the success value of this validation or run the given function on the failure.
- Definition Classes
- Validation
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
|[AA >: Nothing](x: ⇒ AA): AA
Return the success value of this validation or the given default if failure.
Return the success value of this validation or the given default if failure. Alias for
getOrElse
- Definition Classes
- Validation
-
def
|||[EE >: E, AA >: Nothing](x: ⇒ Validation[EE, AA]): Validation[EE, AA]
Return this if it is a success, otherwise, return the given value.
Return this if it is a success, otherwise, return the given value. Alias for
orElse
- Definition Classes
- Validation
-
def
~[EE, AA](k: (Validation[Nothing, E]) ⇒ Validation[AA, EE]): Validation[EE, AA]
Run the given function on this swapped value.
Run the given function on this swapped value. Alias for
swapped
- Definition Classes
- Validation
Deprecated Value Members
-
def
:?>>[X](success: ⇒ X): SwitchingValidation[X]
If this validation is success, return the given X value, otherwise, return the X value given to the return value.
If this validation is success, return the given X value, otherwise, return the X value given to the return value.
- Definition Classes
- Validation
- Annotations
- @deprecated
- Deprecated
(Since version 7.3.0) Due to SI-1980, <<?: will always evaluate its left argument; use foldConst instead