final class Opt[+A] extends AnyVal with Serializable
Like Option but avoids boxing and treats null as no value. Therefore, there is no equivalent for Some(null).
Author: ghik Created: 07/01/16.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Opt
- Serializable
- Serializable
- AnyVal
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
boxed[B](implicit boxing: Boxing[A, B]): Opt[B]
- Annotations
- @inline()
-
def
collect[B](pf: PartialFunction[A, B]): Opt[B]
- Annotations
- @inline()
-
def
contains[A1 >: A](elem: A1): Boolean
- Annotations
- @inline()
-
def
exists(p: (A) ⇒ Boolean): Boolean
- Annotations
- @inline()
-
def
filter(p: (A) ⇒ Boolean): Opt[A]
- Annotations
- @inline()
-
def
filterNot(p: (A) ⇒ Boolean): Opt[A]
- Annotations
- @inline()
-
def
flatMap[B](f: (A) ⇒ Opt[B]): Opt[B]
- Annotations
- @inline()
-
def
flatten[B](implicit ev: <:<[A, Opt[B]]): Opt[B]
- Annotations
- @inline()
-
def
fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B): B
- Annotations
- @inline()
-
def
forall(p: (A) ⇒ Boolean): Boolean
- Annotations
- @inline()
-
def
foreach[U](f: (A) ⇒ U): Unit
- Annotations
- @inline()
-
def
get: A
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
def
getOrElse[B >: A](default: ⇒ B): B
- Annotations
- @inline()
-
def
isDefined: Boolean
- Annotations
- @inline()
-
def
isEmpty: Boolean
- Annotations
- @inline()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterator: Iterator[A]
- Annotations
- @inline()
-
def
map[B](f: (A) ⇒ B): Opt[B]
- Annotations
- @inline()
-
def
nonEmpty: Boolean
- Annotations
- @inline()
-
def
orElse[B >: A](alternative: ⇒ Opt[B]): Opt[B]
- Annotations
- @inline()
-
def
orNull[B >: A](implicit ev: <:<[Null, B]): B
- Annotations
- @inline()
-
def
toLeft[X](right: ⇒ X): Either[A, X]
- Annotations
- @inline()
-
def
toList: List[A]
- Annotations
- @inline()
-
def
toOptRef[B >: Null](implicit boxing: Boxing[A, B]): OptRef[B]
- Annotations
- @inline()
-
def
toOption: Option[A]
- Annotations
- @inline()
-
def
toRight[X](left: ⇒ X): Either[X, A]
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- Opt → Any
-
def
unboxed[B](implicit unboxing: Unboxing[B, A]): Opt[B]
- Annotations
- @inline()
-
def
withFilter(p: (A) ⇒ Boolean): WithFilter[A]
- Annotations
- @inline()