Packages

final case class Invalid[+E](e: E) extends Validated[E, Nothing] with Product with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Invalid
  2. Validated
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Invalid(e: E)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def ===[EE >: E, AA >: Nothing](that: Validated[EE, AA])(implicit EE: Eq[EE], AA: Eq[AA]): Boolean
    Definition Classes
    Validated
  5. def andThen[EE >: E, B](f: (Nothing) ⇒ Validated[EE, B]): Validated[EE, B]

    Apply a function (that returns a Validated) in the valid case.

    Apply a function (that returns a Validated) in the valid case. Otherwise return the original Validated.

    This allows "chained" validation: the output of one validation can be fed into another validation function.

    This function is similar to flatMap on Either. It's not called flatMap, because by Cats convention, flatMap is a monadic bind that is consistent with ap. This method is not consistent with ap (or other Apply-based methods), because it has "fail-fast" behavior as opposed to accumulating validation failures.

    Definition Classes
    Validated
  6. def ap[EE >: E, B](f: Validated[EE, (Nothing) ⇒ B])(implicit EE: Semigroup[EE]): Validated[EE, B]

    From Apply: if both the function and this value are Valid, apply the function

    From Apply: if both the function and this value are Valid, apply the function

    Definition Classes
    Validated
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def bimap[EE, AA](fe: (E) ⇒ EE, fa: (Nothing) ⇒ AA): Validated[EE, AA]

    Validated is a Bifunctor, this method applies one of the given functions.

    Validated is a Bifunctor, this method applies one of the given functions.

    Definition Classes
    Validated
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  10. def combine[EE >: E, AA >: Nothing](that: Validated[EE, AA])(implicit EE: Semigroup[EE], AA: Semigroup[AA]): Validated[EE, AA]

    Combine this Validated with another Validated, using the Semigroup instances of the underlying E and A instances.

    Combine this Validated with another Validated, using the Semigroup instances of the underlying E and A instances. The resultant Validated will be Valid, if, and only if, both this Validated instance and the supplied Validated instance are also Valid.

    Definition Classes
    Validated
  11. def compare[EE >: E, AA >: Nothing](that: Validated[EE, AA])(implicit EE: Order[EE], AA: Order[AA]): Int
    Definition Classes
    Validated
  12. val e: E
  13. def ensure[EE >: E](onFailure: ⇒ EE)(f: (Nothing) ⇒ Boolean): Validated[EE, Nothing]

    Ensure that a successful result passes the given predicate, falling back to an Invalid of onFailure if the predicate returns false.

    Ensure that a successful result passes the given predicate, falling back to an Invalid of onFailure if the predicate returns false.

    For example:

    scala> Validated.valid("").ensure(new IllegalArgumentException("Must not be empty"))(_.nonEmpty)
    res0: Validated[IllegalArgumentException, String] = Invalid(java.lang.IllegalArgumentException: Must not be empty)
    Definition Classes
    Validated
  14. def ensureOr[EE >: E](onFailure: (Nothing) ⇒ EE)(f: (Nothing) ⇒ Boolean): Validated[EE, Nothing]

    Ensure that a successful result passes the given predicate, falling back to the an Invalid of the result of onFailure if the predicate returns false.

    Ensure that a successful result passes the given predicate, falling back to the an Invalid of the result of onFailure if the predicate returns false.

    For example:

    scala> Validated.valid("ab").ensureOr(s => new IllegalArgumentException("Must be longer than 3, provided '" + s + "'"))(_.length > 3)
    res0: Validated[IllegalArgumentException, String] = Invalid(java.lang.IllegalArgumentException: Must be longer than 3, provided 'ab')
    Definition Classes
    Validated
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def exists(predicate: (Nothing) ⇒ Boolean): Boolean

    Is this Valid and matching the given predicate

    Is this Valid and matching the given predicate

    Definition Classes
    Validated
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def findValid[EE >: E, AA >: Nothing](that: ⇒ Validated[EE, AA])(implicit EE: Semigroup[EE]): Validated[EE, AA]

    If this is valid return this, otherwise if that is valid return that, otherwise combine the failures.

    If this is valid return this, otherwise if that is valid return that, otherwise combine the failures. This is similar to orElse except that here failures are accumulated.

    Definition Classes
    Validated
  19. def fold[B](fe: (E) ⇒ B, fa: (Nothing) ⇒ B): B
    Definition Classes
    Validated
  20. def foldLeft[B](b: B)(f: (B, Nothing) ⇒ B): B

    apply the given function to the value with the given B when valid, otherwise return the given B

    apply the given function to the value with the given B when valid, otherwise return the given B

    Definition Classes
    Validated
  21. def foldRight[B](lb: Eval[B])(f: (Nothing, Eval[B]) ⇒ Eval[B]): Eval[B]

    Lazily-apply the given function to the value with the given B when valid, otherwise return the given B.

    Lazily-apply the given function to the value with the given B when valid, otherwise return the given B.

    Definition Classes
    Validated
  22. def forall(f: (Nothing) ⇒ Boolean): Boolean

    Is this Invalid or matching the predicate

    Is this Invalid or matching the predicate

    Definition Classes
    Validated
  23. def foreach(f: (Nothing) ⇒ Unit): Unit

    Run the side-effecting function on the value if it is Valid

    Run the side-effecting function on the value if it is Valid

    Definition Classes
    Validated
  24. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def getOrElse[B >: Nothing](default: ⇒ B): B

    Return the Valid value, or the default if Invalid

    Return the Valid value, or the default if Invalid

    Definition Classes
    Validated
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def isInvalid: Boolean
    Definition Classes
    Validated
  28. def isValid: Boolean
    Definition Classes
    Validated
  29. def leftMap[EE](f: (E) ⇒ EE): Validated[EE, Nothing]

    Apply a function to an Invalid value, returning a new Invalid value.

    Apply a function to an Invalid value, returning a new Invalid value. Or, if the original valid was Valid, return it.

    Definition Classes
    Validated
  30. def map[B](f: (Nothing) ⇒ B): Validated[E, B]

    Apply a function to a Valid value, returning a new Valid value

    Apply a function to a Valid value, returning a new Valid value

    Definition Classes
    Validated
  31. def merge[EE >: E](implicit ev: <:<[Nothing, EE]): EE
    Definition Classes
    Validated
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def orElse[EE, AA >: Nothing](default: ⇒ Validated[EE, AA]): Validated[EE, AA]

    Return this if it is Valid, or else fall back to the given default.

    Return this if it is Valid, or else fall back to the given default. The functionality is similar to that of findValid except for failure accumulation, where here only the error on the right is preserved and the error on the left is ignored.

    Definition Classes
    Validated
  36. def partialCompare[EE >: E, AA >: Nothing](that: Validated[EE, AA])(implicit EE: PartialOrder[EE], AA: PartialOrder[AA]): Double
    Definition Classes
    Validated
  37. def product[EE >: E, B](fb: Validated[EE, B])(implicit EE: Semigroup[EE]): Validated[EE, (Nothing, B)]

    From Product

    From Product

    Definition Classes
    Validated
  38. def show[EE >: E, AA >: Nothing](implicit EE: Show[EE], AA: Show[AA]): String
    Definition Classes
    Validated
  39. def swap: Validated[Nothing, E]
    Definition Classes
    Validated
  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. def toEither: Either[E, Nothing]

    Converts the value to an Either[E, A]

    Converts the value to an Either[E, A]

    Definition Classes
    Validated
  42. def toIor: Ior[E, Nothing]

    Returns Valid values wrapped in Ior.Right, and None for Ior.Left values

    Returns Valid values wrapped in Ior.Right, and None for Ior.Left values

    Definition Classes
    Validated
  43. def toList: List[Nothing]

    Convert this value to a single element List if it is Valid, otherwise return an empty List

    Convert this value to a single element List if it is Valid, otherwise return an empty List

    Definition Classes
    Validated
  44. def toOption: Option[Nothing]

    Returns Valid values wrapped in Some, and None for Invalid values

    Returns Valid values wrapped in Some, and None for Invalid values

    Definition Classes
    Validated
  45. def toValidatedNel[EE >: E, AA >: Nothing]: ValidatedNel[EE, AA]

    Lift the Invalid value into a NonEmptyList.

    Lift the Invalid value into a NonEmptyList.

    Definition Classes
    Validated
  46. def traverse[F[_], EE >: E, B](f: (Nothing) ⇒ F[B])(implicit F: Applicative[F]): F[Validated[EE, B]]

    When Valid, apply the function, marking the result as valid inside the Applicative's context, when Invalid, lift the Error into the Applicative's context

    When Valid, apply the function, marking the result as valid inside the Applicative's context, when Invalid, lift the Error into the Applicative's context

    Definition Classes
    Validated
  47. def valueOr[B >: Nothing](f: (E) ⇒ B): B

    Return the Valid value, or the result of f if Invalid

    Return the Valid value, or the result of f if Invalid

    Definition Classes
    Validated
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  51. def withEither[EE, B](f: (Either[E, Nothing]) ⇒ Either[EE, B]): Validated[EE, B]

    Convert to an Either, apply a function, convert back.

    Convert to an Either, apply a function, convert back. This is handy when you want to use the Monadic properties of the Either type.

    Definition Classes
    Validated

Inherited from Validated[E, Nothing]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped