object Or extends Serializable
The companion object for Or providing factory methods for creating Ors from Eithers and Trys.
- Source
- Or.scala
- Alphabetic
- By Inheritance
- Or
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def from[G, B](option: Option[G], orElse: => B): Or[G, B]
Constructs a new
Orfrom the givenOption.Constructs a new
Orfrom the givenOption.- option
the
Optionto convert to anOr- orElse
the
Badvalue to use if theOptionpassed asoptionisNone.- returns
a new
OrwhoseGoodtype is theOption's type and whoseBadtype is the type of the passedorElseparameter.
- def from[B, G](either: Either[B, G]): Or[G, B]
Constructs a new
Orfrom the givenEither.Constructs a new
Orfrom the givenEither.Note that values effectively “switch sides” when converting an
Eitherto anOr. If the type of theEitherwhich you pass toOr.fromisEither[ErrorMessage, Int]for example, the result will be anOr[Int, ErrorMessage]. The reason is that the convention forEitheris thatLeftis used for “bad” values andRightis used for “good” ones. If you with to keep the types on the same side, invokeswapon theEitherbefore passing it tofrom.- either
the
Eitherto convert to anOr- returns
a new
OrwhoseGoodtype is theEither'sRighttype and whoseBadtype isEither'sLefttype.
- def from[G](theTry: Try[G]): Or[G, Throwable]
Constructs a new
Orfrom the givenTry.Constructs a new
Orfrom the givenTry.- theTry
the
Tryto convert to anOr- returns
a new
OrwhoseGoodtype is theTry'sSuccesstype and whoseBadtype isThrowable.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()