Packages

object Option extends java.io.Serializable

Source
Option.scala
Linear Supertypes
java.io.Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Option
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def apply[A](x: A): Option[A]

    An Option factory which creates Some(x) if the argument is not null, and None if it is null.

    An Option factory which creates Some(x) if the argument is not null, and None if it is null.

    x

    the value

    returns

    Some(value) if value != null, None if value == null

  2. def empty[A]: Option[A]

    An Option factory which returns None in a manner consistent with the collections hierarchy.

  3. implicit def option2Iterable[A](xo: Option[A]): Iterable[A]

    An implicit conversion that converts an option to an iterable value

  4. def unless[A](cond: Boolean)(a: => A): Option[A]

    Unless a given condition is true, this will evaluate the a argument and return Some(a).

    Unless a given condition is true, this will evaluate the a argument and return Some(a). Otherwise, a is not evaluated and None is returned.

    Annotations
    @inline()
  5. def when[A](cond: Boolean)(a: => A): Option[A]

    When a given condition is true, evaluates the a argument and returns Some(a).

    When a given condition is true, evaluates the a argument and returns Some(a). When the condition is false, a is not evaluated and None is returned.