Attributes
- Companion
- class
- Source
- Validated.scala
- Graph
-
- Supertypes
- Self type
-
Validated.type
Members list
Type members
Classlikes
Attributes
- Source
- Validated.scala
- Supertypes
Inherited types
The names of the product elements
The name of the type
Value members
Concrete methods
Evaluates the specified block, catching exceptions of the specified type and returning them on the invalid side of the resulting Validated
.
Evaluates the specified block, catching exceptions of the specified type and returning them on the invalid side of the resulting Validated
. Uncaught exceptions are propagated.
For example:
scala> Validated.catchOnly[NumberFormatException] { "foo".toInt }
res0: Validated[NumberFormatException, Int] = Invalid(java.lang.NumberFormatException: For input string: "foo")
This method and its usage of NotNull are inspired by and derived from the fromTryCatchThrowable
method contributed to Scalaz by Brian McKenna.
Attributes
- Source
- Validated.scala
Inherited methods
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
If the condition is satisfied, return the given A
as valid, otherwise return the given E
as invalid.
If the condition is satisfied, return the given A
as valid, otherwise return the given E
as invalid.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
If the condition is satisfied, return the given B
as valid NEC, otherwise return the given A
as invalid NEC.
If the condition is satisfied, return the given B
as valid NEC, otherwise return the given A
as invalid NEC.
Attributes
- Inherited from:
- ValidatedFunctionsBinCompat0 (hidden)
- Source
- Validated.scala
If the condition is satisfied, return the given A
as valid NEL, otherwise return the given E
as invalid NEL.
If the condition is satisfied, return the given A
as valid NEL, otherwise return the given E
as invalid NEL.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts an Either[A, B]
to a Validated[A, B]
.
Converts an Either[A, B]
to a Validated[A, B]
.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts an Ior[A, B]
to a Validated[A, B]
.
Converts an Ior[A, B]
to a Validated[A, B]
.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts an Option[B]
to a Validated[A, B]
, where the provided ifNone
values is returned on the invalid of the Validated
when the specified Option
is None
.
Converts an Option[B]
to a Validated[A, B]
, where the provided ifNone
values is returned on the invalid of the Validated
when the specified Option
is None
.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts a Try[A]
to a Validated[Throwable, A]
.
Converts a Try[A]
to a Validated[Throwable, A]
.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts an E
to a Validated[E, A]
.
Converts an E
to a Validated[E, A]
.
For example:
scala> Validated.invalid[IllegalArgumentException, String](new IllegalArgumentException("Argument is nonzero"))
res0: Validated[IllegalArgumentException, String] = Invalid(java.lang.IllegalArgumentException: Argument is nonzero)
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts an A
to a ValidatedNec[A, B]
.
Converts an A
to a ValidatedNec[A, B]
.
For example:
scala> Validated.invalidNec[IllegalArgumentException, String](new IllegalArgumentException("Argument is nonzero"))
res0: ValidatedNec[IllegalArgumentException, String] = Invalid(Chain(java.lang.IllegalArgumentException: Argument is nonzero))
Attributes
- Inherited from:
- ValidatedFunctionsBinCompat0 (hidden)
- Source
- Validated.scala
Converts an E
to a ValidatedNel[E, A]
.
Converts an E
to a ValidatedNel[E, A]
.
For example:
scala> Validated.invalidNel[IllegalArgumentException, String](new IllegalArgumentException("Argument is nonzero"))
res0: ValidatedNel[IllegalArgumentException, String] = Invalid(NonEmptyList(java.lang.IllegalArgumentException: Argument is nonzero))
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Cached value of Valid(())
to avoid allocations for a common case.
Cached value of Valid(())
to avoid allocations for a common case.
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts a A
to a Validated[E, A]
.
Converts a A
to a Validated[E, A]
.
For example:
scala> Validated.valid[IllegalArgumentException, String]("Hello world")
res0: Validated[IllegalArgumentException, String] = Valid(Hello world)
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Converts a B
to a ValidatedNec[A, B]
.
Converts a B
to a ValidatedNec[A, B]
.
For example:
scala> Validated.validNec[IllegalArgumentException, String]("Hello world")
res0: ValidatedNec[IllegalArgumentException, String] = Valid(Hello world)
Attributes
- Inherited from:
- ValidatedFunctionsBinCompat0 (hidden)
- Source
- Validated.scala
Converts a A
to a ValidatedNel[E, A]
.
Converts a A
to a ValidatedNel[E, A]
.
For example:
scala> Validated.validNel[IllegalArgumentException, String]("Hello world")
res0: ValidatedNel[IllegalArgumentException, String] = Valid(Hello world)
Attributes
- Inherited from:
- ValidatedFunctions (hidden)
- Source
- Validated.scala
Implicits
Inherited implicits
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances1 (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances2 (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances1 (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances1 (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances (hidden)
- Source
- Validated.scala
Attributes
- Inherited from:
- ValidatedInstances2 (hidden)
- Source
- Validated.scala