object Validated
- Source
- Validated.scala
- Alphabetic
- By Inheritance
- Validated
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromEither[A](either: Either[Seq[String], A]): Validated[A]
Turns an
Either[Seq[String], A]into aValidated[A] - def fromOption[A](maybeA: Option[A])(error: => String): Validated[A]
Turns
Noneinto an invalid value, using the givenerrormessage.Turns
Noneinto an invalid value, using the givenerrormessage. Turns aSome[A]value into aValid[A]value. - def fromTry[A](tryA: Try[A]): Validated[A]
Turns a
Success[A]into aValid[A]Turns a
Success[A]into aValid[A]Turns a
Failure[A]into an invalid value, using the exception message as an 'error' message - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def sequence[A, CC[X] <: IterableOnce[X]](in: CC[Validated[A]])(implicit bf: BuildFrom[CC[Validated[A]], A, CC[A]]): Validated[CC[A]]
Turns a collection of valid values into a valid collection of values.
Turns a collection of valid values into a valid collection of values. If all the values in the collection are
Valid, the result will beValid. If there is at least oneInvalid, the result will be anInvalidcontaining the error messages of allInvalids If the collection is empty, it will return aValidempty collection.- A
the type of the
Validatedvalues (e.g.Int)- CC
the type of the collection of
Validatedvalues (e.g.List)- in
the collection of
Validatedvalues that will be sequenced- returns
the
Validatedof the resulting collection
- See also
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[A, B, CC[X] <: IterableOnce[X]](in: CC[A])(fn: (A) => Validated[B])(implicit bf: BuildFrom[CC[A], B, CC[B]]): Validated[CC[B]]
Validates a collection of values using the provided function
A => Validated[B]to validate every value.Validates a collection of values using the provided function
A => Validated[B]to validate every value. If all the values in the collection areValid, the result will beValid. If there is at least oneInvalid, the result will be anInvalidcontaining the error messages of allInvalids If the collection is empty, it will return aValidempty collection.val myValidatedList = Validated.traverse(myList)(x => myValidateFunc(x))
- A
the type of the values to be validated (e.g.
String)- B
the type of the returned validated values (e.g.
Int)- CC
the type of the collection of
Validated(e.g.List)- in
the collection of values to be validated with the provided function
- fn
the validation function
- returns
the
Validatedof the resulting collection
- See also
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])