Bad

final case class Bad[+B](b: B) extends Or[Nothing, B]

Contains a “bad” value.

You can decide what “bad” means, but it is expected Bad will be commonly used to hold descriptions of an error (or several, accumulated errors). Some examples of possible error descriptions are String error messages, Int error codes, Throwable exceptions, or instances of a case class hierarchy designed to describe errors.

Value parameters:
b

the “bad” value

Source:
Or.scala
class Or[Nothing, B]
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def accumulating: Or[Nothing, One[B]]
Source:
Or.scala
def badMap[C](f: B => C): Or[Nothing, C]
Source:
Or.scala
def exists(p: Nothing => Boolean): Boolean
Source:
Or.scala
def filter[C >: B](f: Nothing => Validation[C]): Or[Nothing, C]
Source:
Or.scala
def flatMap[H, C >: B](f: Nothing => Or[H, C]): Or[H, C]
Source:
Or.scala
def fold[V](gf: Nothing => V, bf: B => V): V
Source:
Or.scala
def forall(p: Nothing => Boolean): Boolean
Source:
Or.scala
def foreach(f: Nothing => Unit): Unit
Source:
Or.scala
def get: Nothing
Source:
Or.scala
def getOrElse[H](default: => H): H
Source:
Or.scala
def map[H](f: Nothing => H): Or[H, B]
Source:
Or.scala
def orElse[H, C >: B](alternative: => Or[H, C]): Or[H, C]
Source:
Or.scala
def recover[H](f: B => H): Or[H, B]
Source:
Or.scala
def recoverWith[H, C](f: B => Or[H, C]): Or[H, C]
Source:
Or.scala
def swap: Or[B, Nothing]
Source:
Or.scala
def toEither: Either[B, Nothing]
Source:
Or.scala
def toOption: None.type
Source:
Or.scala
def toSeq: IndexedSeq[Nothing]
Source:
Or.scala
def toTry(implicit ev: B <:< Throwable): Failure[Nothing]
Source:
Or.scala
def transform[H, C](gf: Nothing => Or[H, C], bf: B => Or[H, C]): Or[H, C]
Source:
Or.scala

Deprecated methods

@deprecated("The asOr is no longer needed because Good(value).orBad[Type] and Good[Type].orBad(value) now return Or. You can delete invocations of asOr in those cases, otherwise, please use a type annotation to widen the type, like (Good(3): Int Or ErrorMessage).")
override def asOr: Or[Nothing, B]

The asOr method has been deprecated and will be removed in a future version of Scalactic. Please remove invocations of asOr in expressions of type Good(value).orBad[Type] and Good[Type].orBad(value) (which now return a type already widened to Or), otherwise please use a type annotation to widen the type, such as: (Good(3): Int Or ErrorMessage).

The asOr method has been deprecated and will be removed in a future version of Scalactic. Please remove invocations of asOr in expressions of type Good(value).orBad[Type] and Good[Type].orBad(value) (which now return a type already widened to Or), otherwise please use a type annotation to widen the type, such as: (Good(3): Int Or ErrorMessage).

Deprecated
Definition Classes
Source:
Or.scala

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product
def withFilter[C >: B](f: Nothing => Validation[C]): Or[Nothing, C]

Currently just forwards to filter, and therefore, returns the same result.

Currently just forwards to filter, and therefore, returns the same result.

Inherited from:
Or
Source:
Or.scala

Concrete fields

override val isBad: Boolean
Source:
Or.scala

Inherited fields

val isGood: Boolean

Indicates whether this Or is a Good

Indicates whether this Or is a Good

Returns:

true if this Or is a Good, false if it is a Bad.

Inherited from:
Or
Source:
Or.scala