Packages

sealed abstract class Option[A] extends Iterable[A]

This class represents optional values. Instances of Option are either instances of case class Some or it is case object None.

Source
JavaAPI.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Option
  2. Iterable
  3. AnyRef
  4. Any
Implicitly
  1. by java2ScalaOption
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def asScala: scala.Option[A]
  2. abstract def get: A
  3. abstract def getOrElse[B >: A](defaultValue: B): B

    Returns a if this is some(a) or defaultValue if this is none.

  4. abstract def isEmpty: Boolean

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Option[A] toany2stringadd[Option[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Option[A], B)
    Implicit
    This member is added by an implicit conversion from Option[A] toArrowAssoc[Option[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def canEqual(that: Any): Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Equals
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  9. final def collect[B](pf: PartialFunction[A, B]): scala.Option[B]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  10. final def contains[A1 >: A](elem: A1): Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  11. def ensuring(cond: (Option[A]) => Boolean, msg: => Any): Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toEnsuring[Option[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (Option[A]) => Boolean): Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toEnsuring[Option[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: => Any): Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toEnsuring[Option[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toEnsuring[Option[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. final def exists(p: (A) => Boolean): Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  18. final def filter(p: (A) => Boolean): scala.Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  19. final def filterNot(p: (A) => Boolean): scala.Option[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  20. final def flatMap[B](f: (A) => scala.Option[B]): scala.Option[B]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  21. def flatten[B](implicit ev: <:<[A, scala.Option[B]]): scala.Option[B]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  22. final def fold[B](ifEmpty: => B)(f: (A) => B): B
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  23. def forEach(arg0: Consumer[_ >: A <: AnyRef]): Unit
    Definition Classes
    Iterable
  24. final def forall(p: (A) => Boolean): Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  25. final def foreach[U](f: (A) => U): Unit
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  26. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  28. def isDefined: Boolean
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def iterator(): Iterator[A]
    Definition Classes
    Option → Iterable
  31. final def knownSize: Int
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option → IterableOnce
  32. final def map[B](f: (A) => B): scala.Option[B]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def nonEmpty: Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  37. final def orElse[B >: A](alternative: => scala.Option[B]): scala.Option[B]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  38. final def orNull[A1 >: A](implicit ev: <:<[Null, A1]): A1
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  39. def productArity: Int
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  40. def productElement(n: Int): Any
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  41. def productElementName(n: Int): String
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  42. def productElementNames: Iterator[String]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  43. def productIterator: Iterator[Any]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  44. def productPrefix: String
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Product
  45. def spliterator(): Spliterator[A]
    Definition Classes
    Iterable
  46. def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    IterableOnce
  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. final def toLeft[X](right: => X): Either[A, X]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  49. def toList: List[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  50. final def toRight[X](left: => X): Either[X, A]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. final def unzip[A1, A2](implicit asPair: <:<[A, (A1, A2)]): (scala.Option[A1], scala.Option[A2])
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  53. final def unzip3[A1, A2, A3](implicit asTriple: <:<[A, (A1, A2, A3)]): (scala.Option[A1], scala.Option[A2], scala.Option[A3])
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  56. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  57. final def withFilter(p: (A) => Boolean): WithFilter
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option
    Annotations
    @inline()
  58. final def zip[A1 >: A, B](that: scala.Option[B]): scala.Option[(A1, B)]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Definition Classes
    Option

Shadowed Implicit Value Members

  1. def get: A
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (option: scala.Option[A]).get
    Definition Classes
    Option
  2. final def getOrElse[B >: A](default: => B): B
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (option: scala.Option[A]).getOrElse(default)
    Definition Classes
    Option
    Annotations
    @inline()
  3. final def isDefined: Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (option: scala.Option[A]).isDefined
    Definition Classes
    Option
  4. final def isEmpty: Boolean
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (option: scala.Option[A]).isEmpty
    Definition Classes
    Option
  5. def iterator: Iterator[A]
    Implicit
    This member is added by an implicit conversion from Option[A] toscala.Option[A] performed by method java2ScalaOption in org.apache.pekko.japi.Option.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (option: scala.Option[A]).iterator
    Definition Classes
    Option → IterableOnce

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Option[A] toStringFormat[Option[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (Option[A], B)
    Implicit
    This member is added by an implicit conversion from Option[A] toArrowAssoc[Option[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Iterable[A]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion java2ScalaOption fromOption[A] to scala.Option[A]

Inherited by implicit conversion any2stringadd fromOption[A] to any2stringadd[Option[A]]

Inherited by implicit conversion StringFormat fromOption[A] to StringFormat[Option[A]]

Inherited by implicit conversion Ensuring fromOption[A] to Ensuring[Option[A]]

Inherited by implicit conversion ArrowAssoc fromOption[A] to ArrowAssoc[Option[A]]

Ungrouped