Class/Object

com.avsystem.commons.misc

NOpt

Related Docs: object NOpt | package misc

Permalink

final class NOpt[+A] extends AnyVal with Serializable

Like Opt but does have a counterpart for Some(null). In other words, NOpt is a "nullable Opt".

Linear Supertypes
Serializable, Serializable, AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NOpt
  2. Serializable
  3. Serializable
  4. AnyVal
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 boxed[B](implicit boxing: Boxing[A, B]): NOpt[B]

    Permalink
    Annotations
    @inline()
  6. def collect[B](pf: PartialFunction[A, B]): NOpt[B]

    Permalink
    Annotations
    @inline()
  7. def contains[A1 >: A](elem: A1): Boolean

    Permalink
    Annotations
    @inline()
  8. def exists(p: (A) ⇒ Boolean): Boolean

    Permalink
    Annotations
    @inline()
  9. def filter(p: (A) ⇒ Boolean): NOpt[A]

    Permalink
    Annotations
    @inline()
  10. def filterNot(p: (A) ⇒ Boolean): NOpt[A]

    Permalink
    Annotations
    @inline()
  11. def flatMap[B](f: (A) ⇒ NOpt[B]): NOpt[B]

    Permalink
    Annotations
    @inline()
  12. def flatten[B](implicit ev: <:<[A, NOpt[B]]): NOpt[B]

    Permalink
    Annotations
    @inline()
  13. def fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B): B

    Permalink
    Annotations
    @inline()
  14. def forEmpty(sideEffect: ⇒ Unit): NOpt[A]

    Permalink

    Apply side effect only if NOpt is empty.

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

    sideEffect

    - code to be executed if nopt is empty

    returns

    the same nopt

    Annotations
    @inline()
    Example:
    1. captionNOpt.forEmpty(logger.warn("caption is empty")).foreach(setCaption)
  15. def forall(p: (A) ⇒ Boolean): Boolean

    Permalink
    Annotations
    @inline()
  16. def foreach[U](f: (A) ⇒ U): Unit

    Permalink
    Annotations
    @inline()
  17. def get: A

    Permalink
    Annotations
    @inline()
  18. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  19. def getOrElse[B >: A](default: ⇒ B): B

    Permalink
    Annotations
    @inline()
  20. def isDefined: Boolean

    Permalink
    Annotations
    @inline()
  21. def isEmpty: Boolean

    Permalink
    Annotations
    @inline()
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. def iterator: Iterator[A]

    Permalink
    Annotations
    @inline()
  24. def map[B](f: (A) ⇒ B): NOpt[B]

    Permalink
    Annotations
    @inline()
  25. def nonEmpty: Boolean

    Permalink
    Annotations
    @inline()
  26. def orElse[B >: A](alternative: ⇒ NOpt[B]): NOpt[B]

    Permalink
    Annotations
    @inline()
  27. def orNull[B >: A](implicit ev: <:<[Null, B]): B

    Permalink
    Annotations
    @inline()
  28. def toLeft[X](right: ⇒ X): Either[A, X]

    Permalink
    Annotations
    @inline()
  29. def toList: List[A]

    Permalink
    Annotations
    @inline()
  30. def toOpt: Opt[A]

    Permalink

    Converts this NOpt into Opt.

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

    Annotations
    @inline()
  31. def toOptArg: OptArg[A]

    Permalink

    Converts this NOpt into OptArg.

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

    Annotations
    @inline()
  32. def toOptRef[B >: Null](implicit boxing: Boxing[A, B]): OptRef[B]

    Permalink

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

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

    Annotations
    @inline()
  33. def toOption: Option[A]

    Permalink
    Annotations
    @inline()
  34. def toRight[X](left: ⇒ X): Either[X, A]

    Permalink
    Annotations
    @inline()
  35. def toString(): String

    Permalink
    Definition Classes
    NOpt → Any
  36. def unboxed[B](implicit unboxing: Unboxing[B, A]): NOpt[B]

    Permalink
    Annotations
    @inline()
  37. def withFilter(p: (A) ⇒ Boolean): WithFilter[A]

    Permalink
    Annotations
    @inline()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyVal

Inherited from Any

Ungrouped