final case class Invalid[+E](error: E) extends Result[E, Nothing] with Product with Serializable
- Alphabetic
- By Inheritance
- Invalid
- Result
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Invalid(error: E)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
==(other: Result[E, Nothing]): Boolean
[use case]
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
and[B](other: Result[E, B]): Ap2[E, Nothing, 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
Resultthis one should be combined with- returns
a builder to eventually apply two
Results
- Definition Classes
- Result
-
def
append(other: Result[E, Nothing]): Result[E, Nothing]
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef append[EE >: E, AA >: Nothing](other: ⇒ Result[EE, AA]): Result[EE, NonEmptyVector[AA]]
-
def
apply[B](f: Result[E, (Nothing) ⇒ B]): Result[E, B]
[use case] Applies a function in the
Resultcontext to the valid value, accumulating invalids.[use case]Applies a function in the
Resultcontext 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
Resultcontext- returns
the valid result if
thisandfare valid or invalid if one of each is invalid or both invalid values accumulated
- Definition Classes
- Result
-
def
as[B](x: ⇒ B): Result[E, B]
Sets the valid value to
xand discards the previous value if this is a valid Result.Sets the valid value to
xand 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bimap[EE, AA](fe: (E) ⇒ EE, fa: (Nothing) ⇒ 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
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
compare(other: Result[E, Nothing]): Int
[use case]
-
def
contains(x: Nothing): Boolean
[use case] Tests for membership on the valid
Result[use case]Tests for membership on the valid
Result- returns
trueif thisResulthasxas valid value
- Definition Classes
- Result
Full Signaturedef contains[AA >: Nothing](x: ⇒ AA): Boolean
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val error: E
-
def
exists(p: (Nothing) ⇒ Boolean): Boolean
- returns
trueif thisResultis valid and satisfies the predicatep
- Definition Classes
- Result
-
def
filter(p: (Nothing) ⇒ Boolean, ifEmpty: ⇒ E): Result[E, Nothing]
[use case] Filters the valid value of this
Result. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (Nothing) ⇒ Result[E, B]): Result[E, 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.flatMapdoes not accumulate errors. If you want to do so, useandinstead.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
fover the valid value in theResultcontext
- Definition Classes
- Result
-
def
fold[B](fe: (NonEmptyVector[E]) ⇒ B, fa: (Nothing) ⇒ B): B
Folds this
Resultinto a value by applying the first function if this is aInvalidor the second function if this is aValid.Folds this
Resultinto a value by applying the first function if this is aInvalidor the second function if this is aValid.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
-
def
foldLeft[B](b: B)(f: (B, Nothing) ⇒ B): B
A left fold over the valid value.
-
def
foldRight[B](b: B)(f: (Nothing, B) ⇒ B): B
A right fold over the valid value.
-
def
forall(p: (Nothing) ⇒ Boolean): Boolean
- returns
trueif thisResultis invalid or the valid value satisfies the predicatep
- Definition Classes
- Result
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getEither: Nothing
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef getEither[AA >: Nothing](implicit ev: <:<[E, AA]): AA
-
def
getOrElse(a: Nothing): Nothing
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef getOrElse[AA >: Nothing](aa: ⇒ AA): AA
-
def
invalid[B](fe: (NonEmptyVector[E]) ⇒ B)(fa: (Nothing) ⇒ B): B
Curried fold that starts with the invalid part.
-
def
invalidMap[F](f: (E) ⇒ F): Result[F, Nothing]
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
Resultis invalid- returns
the result of the function application in the
Resultcontext
- Definition Classes
- Result
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isInvalid: Boolean
- returns
trueif this is an invalidResult
- Definition Classes
- Result
-
def
isValid: Boolean
- returns
trueif this is a validResult
- Definition Classes
- Result
-
def
map[B](f: (Nothing) ⇒ B): Result[E, 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
Resultis valid- returns
the result of the function application in the
Resultcontext
- Definition Classes
- Result
-
def
merge(other: Result[E, Nothing]): Result[E, Nothing]
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef merge[EE >: E, AA >: Nothing](other: ⇒ Result[EE, AA]): Result[EE, NonEmptyVector[AA]]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nev: Result[E, NonEmptyVector[Nothing]]
- returns
Result where the valid value is wrapped in a NonEmptyVector
- Definition Classes
- Result
- Since
0.2.0
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
orElse(other: Result[E, Nothing]): Result[E, Nothing]
[use case]
-
def
recover(f: (E) ⇒ Nothing): Result[E, Nothing]
[use case] Transforms an invalid Result into a valid one.
-
def
recoverAll(f: (NonEmptyVector[E]) ⇒ Nothing): Result[E, Nothing]
[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 Signaturedef recoverAll[AA >: Nothing](f: (NonEmptyVector[E]) ⇒ AA): Result[E, AA]
-
def
recoverWith[F](f: (E) ⇒ Result[F, Nothing]): Result[F, Nothing]
[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
fover the invalid value in theResultcontext
- Definition Classes
- Result
-
def
swap: Result[Nothing, NonEmptyVector[E]]
- Definition Classes
- Result
-
def
swapped[EE, AA](f: (Result[Nothing, NonEmptyVector[E]]) ⇒ Result[AA, NonEmptyVector[EE]]): Result[EE, NonEmptyVector[AA]]
- Definition Classes
- Result
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toEither: Either[NonEmptyVector[E], Nothing]
- Definition Classes
- Result
-
def
toList: List[Nothing]
- Definition Classes
- Result
-
def
toOption: Option[Nothing]
- returns
a
scala.Option
- Definition Classes
- Result
-
def
toSeq: Seq[Nothing]
- Definition Classes
- Result
-
def
toSet: Set[Nothing]
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef toSet[AA >: Nothing]: Set[AA]
-
def
toStream: Stream[Nothing]
- Definition Classes
- Result
-
def
toTry: Try[Nothing]
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef toTry(implicit ev: <:<[E, Throwable]): Try[Nothing]
-
def
toVector: Vector[Nothing]
- Definition Classes
- Result
-
def
valid[B](fa: (Nothing) ⇒ B)(fe: (NonEmptyVector[E]) ⇒ B): B
Curried fold that starts with the valid part.
-
def
valueOr(x: (E) ⇒ Nothing): Nothing
[use case]
[use case]- Definition Classes
- Result
Full Signaturedef valueOr[AA >: Nothing](x: (NonEmptyVector[E]) ⇒ AA): AA
-
def
void: Result[E, 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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zip[B](b: Result[E, B]): Result[E, (Nothing, B)]
[use case] Combines two
Resultby zipping their valid values together, accumulating errors.
Inherited from Result[E, Nothing]
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.