Validated

endpoints4s.Validated
See theValidated companion object
sealed trait Validated[+A]

A validated value of type A can either be Valid or Invalid

Type parameters

A

Type of the validated value

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Invalid
class Valid[A]

Members list

Value members

Concrete methods

def flatMap[B](f: A => Validated[B]): Validated[B]

Subsequently validates this valid value. An invalid value is returned as it is.

Subsequently validates this valid value. An invalid value is returned as it is.

Attributes

def fold[B](valid: A => B, invalid: Seq[String] => B): B

Transforms this validated value into a value of type B

Transforms this validated value into a value of type B

Attributes

def map[B](f: A => B): Validated[B]

Transforms a valid value of type A into a valid value of type B. An invalid value is returned as it is.

Transforms a valid value of type A into a valid value of type B. An invalid value is returned as it is.

Attributes

def mapErrors(f: Seq[String] => Seq[String]): Validated[A]

Transforms the error list of an invalid value. A valid value is returned as it is.

Transforms the error list of an invalid value. A valid value is returned as it is.

Attributes

def toEither: Either[Seq[String], A]

Transforms this Validated[A] value into an Either[Seq[String], A] value.

Transforms this Validated[A] value into an Either[Seq[String], A] value.

Attributes

def zip[A0 >: A, B](that: Validated[B])(implicit tupler: Tupler[A0, B]): Validated[Out]

Tuples together two validated values and tries to return a flat tuple instead of nested tuples. Also strips out Unit values in the tuples.

Tuples together two validated values and tries to return a flat tuple instead of nested tuples. Also strips out Unit values in the tuples.

If this and that are both invalid values, this operation returns an Invalid value containing both this error messages and that error messages.

Attributes

See also