sealed
trait
Validation[+E] extends Product with Serializable
Abstract Value Members
-
abstract
def
&&[F >: E](other: ⇒ Validation[F]): Validation[F]
-
abstract
def
canEqual(that: Any): Boolean
-
abstract
def
productArity: Int
-
abstract
def
productElement(n: Int): Any
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
productIterator: Iterator[Any]
-
def
productPrefix: String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from Product
Value Members
-
abstract
def
productArity: Int
-
abstract
def
productElement(n: Int): Any
-
def
productIterator: Iterator[Any]
-
def
productPrefix: String
Inherited from Equals
Value Members
-
abstract
def
canEqual(that: Any): Boolean
Inherited from AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from Any
Value Members
-
final
def
asInstanceOf[T0]: T0
-
final
def
isInstanceOf[T0]: Boolean
Ungrouped
-
abstract
def
&&[F >: E](other: ⇒ Validation[F]): Validation[F]
-
abstract
def
canEqual(that: Any): Boolean
-
abstract
def
productArity: Int
-
abstract
def
productElement(n: Int): Any
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
productIterator: Iterator[Any]
-
def
productPrefix: String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Represents the result of a validation, either the object
Pass
if the validation succeeded, else an instance ofFail
containing an error value describing the validation failure.Validation
s are used to filterOr
s infor
expressions orfilter
method calls. For example, consider these methods:Because
isRound
andisDivBy3
take anInt
and return aValidation[ErrorMessage]
, you can use them in filters infor
expressions involvingOr
s of typeInt
Or
ErrorMessage
. Here's an example:Validation
s can also be used to accumulate error usingwhen
, a method that's made available by traitAccumulation
on accumualtingOr
s (Or
s whoseBad
type is anEvery[T]
). Here are some examples:Note: You can think of
Validation
as an “Option
with attitude,” wherePass
is aNone
that indicates validation success andFail
is aSome
whose value describes the validation failure.the type of error value describing a validation failure for this
Validation