validation.Result

Valid

Related Doc: package Result

final case class Valid[+A](value: A) extends Result[Nothing, A] with Product with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Valid
  2. Result
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Valid(value: A)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def ==(other: Result[Nothing, A]): Boolean

    [use case]

    [use case]
    other

    returns

    Definition Classes
    Result
    Full Signature

    def ==[EE >: Nothing, AA >: A](other: Result[EE, AA])(implicit EE: Equiv[EE], AA: Equiv[AA]): Boolean

  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. def and[B](other: Result[Nothing, B]): Ap2[Nothing, A, B]

    [use case] Combines two Results in a builder, eventually accumulating invalids.

    [use case]

    Combines two Results in a builder, eventually accumulating invalids.

    This is the Applicative Builder of the valid result.

    B

    the other valid type

    other

    the other Result this one should be combined with

    returns

    a builder to eventually apply two Results

    Definition Classes
    Result
    Full Signature

    def and[EE >: Nothing, AA >: A, B](other: Result[EE, B]): Ap2[EE, AA, B]

  6. def append(other: Result[Nothing, A]): Result[Nothing, A]

    [use case]

    [use case]
    other

    returns

    Definition Classes
    Result
    Full Signature

    def append[EE >: Nothing, AA >: A](other: ⇒ Result[EE, AA]): Result[EE, NonEmptyVector[AA]]

  7. def apply[B](f: Result[Nothing, (A) ⇒ B]): Result[Nothing, B]

    [use case] Applies a function in the Result context to the valid value, accumulating invalids.

    [use case]

    Applies a function in the Result context to the valid value, accumulating invalids.

    This is the Applicative Functor of the valid Result.

    B

    the resulting valid type

    f

    the function in the Result context

    returns

    the valid result if this and f are valid or invalid if one of each is invalid or both invalid values accumulated

    Definition Classes
    Result
    Full Signature

    def apply[EE >: Nothing, B](f: Result[EE, (A) ⇒ B]): Result[EE, B]

  8. def as[B](x: ⇒ B): Result[Nothing, B]

    Sets the valid value to x and discards the previous value if this is a valid Result.

    Sets the valid value to x and discards the previous value if this is a valid Result.

    B

    the resulting valid type

    x

    the new valid value

    returns

    the result with the valid value set to x

    Definition Classes
    Result
    Since

    0.2.0

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def bimap[EE, AA](fe: (Nothing) ⇒ EE, fa: (A) ⇒ AA): Result[EE, AA]

    Transforms the value of this Result.

    Transforms the value of this Result.

    EE

    the resulting invalid type

    AA

    the resulting valid type

    fe

    the function to transform an invalid value

    fa

    the function to transform a valid value

    returns

    the result with either the valid or invalid value transformed

    Definition Classes
    Result
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compare(other: Result[Nothing, A]): Int

    [use case]

    [use case]
    other

    returns

    Definition Classes
    Result
    Full Signature

    def compare[EE >: Nothing, AA >: A](other: Result[EE, AA])(implicit EE: Ordering[EE], AA: Ordering[AA]): Int

  13. def contains(x: A): Boolean

    [use case] Tests for membership on the valid Result

    [use case]

    Tests for membership on the valid Result

    x

    returns

    true if this Result has x as valid value

    Definition Classes
    Result
    Full Signature

    def contains[AA >: A](x: ⇒ AA): Boolean

  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def exists(p: (A) ⇒ Boolean): Boolean

    p
    returns

    true if this Result is valid and satisfies the predicate p

    Definition Classes
    Result
  16. def filter(p: (A) ⇒ Boolean, ifEmpty: ⇒ Nothing): Result[Nothing, A]

    [use case] Filters the valid value of this Result.

    [use case]

    Filters the valid value of this Result.

    p

    ifEmpty

    returns

    Definition Classes
    Result
    Full Signature

    def filter[EE >: Nothing](p: (A) ⇒ Boolean, ifEmpty: ⇒ EE): Result[EE, A]

  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def flatMap[B](f: (A) ⇒ Result[Nothing, B]): Result[Nothing, B]

    [use case] Continues validation with the provided function if this is a valid Result.

    [use case]

    Continues validation with the provided function if this is a valid Result.

    flatMap does not accumulate errors. If you want to do so, use and instead.

    This is the Monadic Bind through the valid value.

    B

    the resulting valid type

    f

    the function to continue with

    returns

    the result of applying f over the valid value in the Result context

    Definition Classes
    Result
    Full Signature

    def flatMap[EE >: Nothing, B](f: (A) ⇒ Result[EE, B]): Result[EE, B]

  19. def fold[B](fe: (NonEmptyVector[Nothing]) ⇒ B, fa: (A) ⇒ B): B

    Folds this Result into a value by applying the first function if this is a Invalid or the second function if this is a Valid.

    Folds this Result into a value by applying the first function if this is a Invalid or the second function if this is a Valid.

    This is the Catamorphism.

    B

    the resulting type

    fe

    the function to apply in the invalid case

    fa

    the function to apply in the valid case

    returns

    the result of one of the two functions

    Definition Classes
    Result
  20. def foldLeft[B](b: B)(f: (B, A) ⇒ B): B

    A left fold over the valid value.

    A left fold over the valid value.

    B

    the resulting type

    b

    the initial accumulator

    f

    reducer function of the accumulator and the valid value

    returns

    b if this is Invalid, otherwise the result of applying f

    Definition Classes
    Result
    See also

    fold

  21. def foldRight[B](b: B)(f: (A, B) ⇒ B): B

    A right fold over the valid value.

    A right fold over the valid value.

    B

    the resulting type

    b

    the initial accumulator

    f

    reducer function of the valid value and the accumulator

    returns

    b if this is Invalid, otherwise the result of applying f

    Definition Classes
    Result
    See also

    fold

  22. def forall(p: (A) ⇒ Boolean): Boolean

    p
    returns

    true if this Result is invalid or the valid value satisfies the predicate p

    Definition Classes
    Result
  23. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  24. def getEither: A

    [use case]

    [use case]
    returns

    Definition Classes
    Result
    Full Signature

    def getEither[AA >: A](implicit ev: <:<[Nothing, AA]): AA

  25. def getOrElse(a: A): A

    [use case]

    [use case]
    returns

    Definition Classes
    Result
    Full Signature

    def getOrElse[AA >: A](aa: ⇒ AA): AA

  26. def invalid[B](fe: (NonEmptyVector[Nothing]) ⇒ B)(fa: (A) ⇒ B): B

    Curried fold that starts with the invalid part.

    Curried fold that starts with the invalid part.

    B

    the resulting type

    fe

    the function to apply in the invalid case

    fa

    the function to apply in the valid case

    returns

    the result of one of the two functions

    Definition Classes
    Result
    See also

    fold

  27. def invalidMap[F](f: (Nothing) ⇒ F): Result[F, A]

    Maps over the invalid value of this Result.

    Maps over the invalid value of this Result.

    This is the Functor over the invalid side.

    F

    the resulting invalid type

    f

    the function to apply if this Result is invalid

    returns

    the result of the function application in the Result context

    Definition Classes
    Result
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. def isInvalid: Boolean

    returns

    true if this is an invalid Result

    Definition Classes
    Result
  30. def isValid: Boolean

    returns

    true if this is a valid Result

    Definition Classes
    Result
  31. def map[B](f: (A) ⇒ B): Result[Nothing, B]

    Maps over the valid value of this Result.

    Maps over the valid value of this Result.

    This is the Functor over the valid side.

    B

    the resulting valid type

    f

    the function to apply if this Result is valid

    returns

    the result of the function application in the Result context

    Definition Classes
    Result
  32. def merge(other: Result[Nothing, A]): Result[Nothing, A]

    [use case]

    [use case]
    other

    returns

    Definition Classes
    Result
    Full Signature

    def merge[EE >: Nothing, AA >: A](other: ⇒ Result[EE, AA]): Result[EE, NonEmptyVector[AA]]

  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. def nev: Result[Nothing, NonEmptyVector[A]]

    returns

    Definition Classes
    Result
  35. final def notify(): Unit

    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  37. def orElse(other: Result[Nothing, A]): Result[Nothing, A]

    [use case]

    [use case]
    other

    returns

    Definition Classes
    Result
    Full Signature

    def orElse[EE >: Nothing, AA >: A](other: ⇒ Result[EE, AA]): Result[EE, AA]

  38. def recover(f: (Nothing) ⇒ A): Result[Nothing, A]

    [use case] Transforms an invalid Result into a valid one.

    [use case]

    Transforms an invalid Result into a valid one.

    f

    the function to transform an invalid value into a valid one

    returns

    a result that is always valid

    Definition Classes
    Result
    Full Signature

    def recover[AA >: A](f: (Nothing) ⇒ AA): Result[Nothing, AA]

  39. def recoverAll(f: (NonEmptyVector[Nothing]) ⇒ A): Result[Nothing, A]

    [use case] Transforms an invalid Result into a valid one.

    [use case]

    Transforms an invalid Result into a valid one.

    f

    the function to transform all invalid values into a valid one

    returns

    a result that is always valid

    Definition Classes
    Result
    Full Signature

    def recoverAll[AA >: A](f: (NonEmptyVector[Nothing]) ⇒ AA): Result[Nothing, AA]

  40. def recoverWith[F](f: (Nothing) ⇒ Result[F, A]): Result[F, A]

    [use case] Continues validation with the provided function if this is an invalid Result.

    [use case]

    Continues validation with the provided function if this is an invalid Result.

    This is the Monadic Bind through the invalid value.

    F

    the resulting invalid type

    f

    the function to continue with

    returns

    the result of applying f over the invalid value in the Result context

    Definition Classes
    Result
    Full Signature

    def recoverWith[AA >: A, F](f: (Nothing) ⇒ Result[F, AA]): Result[F, AA]

  41. def swap: Result[A, NonEmptyVector[Nothing]]

    returns

    Definition Classes
    Result
  42. def swapped[EE, AA](f: (Result[A, NonEmptyVector[Nothing]]) ⇒ Result[AA, NonEmptyVector[EE]]): Result[EE, NonEmptyVector[AA]]

    EE
    AA
    f
    returns

    Definition Classes
    Result
  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  44. def toEither: Either[NonEmptyVector[Nothing], A]

    returns

    Definition Classes
    Result
  45. def toList: List[A]

    returns

    Definition Classes
    Result
  46. def toOption: Option[A]

    returns

    a scala.Option

    Definition Classes
    Result
  47. def toSeq: Seq[A]

    returns

    Definition Classes
    Result
  48. def toSet: Set[A]

    [use case]

    [use case]
    returns

    Definition Classes
    Result
    Full Signature

    def toSet[AA >: A]: Set[AA]

  49. def toStream: Stream[A]

    returns

    Definition Classes
    Result
  50. def toTry: Try[A]

    [use case]

    [use case]
    returns

    Definition Classes
    Result
    Full Signature

    def toTry(implicit ev: <:<[Nothing, Throwable]): Try[A]

  51. def toVector: Vector[A]

    returns

    Definition Classes
    Result
  52. def valid[B](fa: (A) ⇒ B)(fe: (NonEmptyVector[Nothing]) ⇒ B): B

    Curried fold that starts with the valid part.

    Curried fold that starts with the valid part.

    B

    the resulting type

    fa

    the function to apply in the valid case

    fe

    the function to apply in the invalid case

    returns

    the result of one of the two functions

    Definition Classes
    Result
    See also

    fold

  53. val value: A

  54. def valueOr(x: (Nothing) ⇒ A): A

    [use case]

    [use case]
    x

    returns

    Definition Classes
    Result
    Full Signature

    def valueOr[AA >: A](x: (NonEmptyVector[Nothing]) ⇒ AA): AA

  55. def void: Result[Nothing, Unit]

    Discards the valid value if this is a valid Result.

    Discards the valid value if this is a valid Result.

    returns

    the result with the valid value set to Unit

    Definition Classes
    Result
    Since

    0.2.0

  56. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. def zip[B](b: Result[Nothing, B]): Result[Nothing, (A, B)]

    [use case] Combines two Result by zipping their valid values together, accumulating errors.

    [use case]

    Combines two Result by zipping their valid values together, accumulating errors.

    B

    b

    returns

    Definition Classes
    Result
    Full Signature

    def zip[EE >: Nothing, B](b: Result[EE, B]): Result[EE, (A, B)]

Inherited from Result[Nothing, A]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Accessors and Extractors

Methods to access or extract a value from this Result.

Transformers

Methods to transform the value of this Result.

Testers

Methods to test the value of this Result for some properties.

Translators

Methods to translate this Result into a different structure.

Combinators

Methods to combine multiple Results.

Ungrouped