final class OptionOps[A] extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OptionOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OptionOps(option: Option[A])

Value Members

  1. def forEmpty(sideEffect: ⇒ Unit): Option[A]

    Apply side effect only if Option is empty.

    Apply side effect only if Option is empty. It's a bit like foreach for None

    sideEffect

    - code to be executed if option is empty

    returns

    the same option

    Example:
    1. captionOpt.forEmpty(logger.warn("caption is empty")).foreach(setCaption)
  2. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  3. def toNOpt: commons.NOpt[A]
  4. def toOpt: commons.Opt[A]

    Converts this Option into Opt.

    Converts this Option into Opt. Because Opt cannot hold null, Some(null) is translated to Opt.Empty.

  5. def toOptArg: commons.OptArg[A]

    Converts this Option into OptArg.

    Converts this Option into OptArg. Because OptArg cannot hold null, Some(null) is translated to OptArg.Empty.

  6. def toOptRef[B >: Null](implicit boxing: Boxing[A, B]): commons.OptRef[B]

    Converts this Option into OptRef, changing the element type into boxed representation if necessary (e.g.

    Converts this Option into OptRef, changing the element type into boxed representation if necessary (e.g. Boolean into java.lang.Boolean). Because OptRef cannot hold null, Some(null) is translated to OptRef.Empty.