00012 Scala Either
sealed abstract class Either[+A, +B] extends Product with Serializable/** The left side of the disjoint union, as opposed to the [[scala.util.Right]] side.
*
* @author <a href="mailto:[email protected]">Tony Morris</a>, Workingmouse
*/
final case class Left[+A, +B](@deprecatedName('a, "2.12.0") value: A) extends Either[A, B] {
def isLeft = true
def isRight = false
@deprecated("Use .value instead.", "2.12.0") def a: A = value
}
/** The right side of the disjoint union, as opposed to the [[scala.util.Left]] side.
*
* @author <a href="mailto:[email protected]">Tony Morris</a>, Workingmouse
*/
final case class Right[+A, +B](@deprecatedName('b, "2.12.0") value: B) extends Either[A, B] {
def isLeft = false
def isRight = true
@deprecated("Use .value instead.", "2.12.0") def b: B = value
}最后更新于
这有帮助吗?