Class

com.avsystem.commons.SharedExtensions

OptionOps

Related Doc: package SharedExtensions

Permalink

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])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def forEmpty(sideEffect: ⇒ Unit): Option[A]

    Permalink

    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)
  6. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  7. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  8. def toNOpt: commons.NOpt[A]

    Permalink
  9. def toOpt: commons.Opt[A]

    Permalink

    Converts this Option into Opt.

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

  10. def toOptArg: commons.OptArg[A]

    Permalink

    Converts this Option into OptArg.

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

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

    Permalink

    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.

  12. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped