sealed trait Optional[+A] extends AnyRef
Custom option type to be used for wrapping external data models where most of the fields are defined to be optional.
Instances of Optional are either Optional.Present or Optional.Absent.
The only difference between this type and scala.Option is that there is an implicit
conversion defined from A
to
Optional[A], and from
Option[A]
.
to
Optional[A]
- Self Type
- Optional[A]
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Optional
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- class WithFilter extends AnyRef
Abstract Value Members
Concrete Value Members
- final def collect[B](pf: PartialFunction[A, B]): Optional[B]
- final def contains[A1 >: A](elem: A1): Boolean
- final def exists(p: (A) => Boolean): Boolean
- final def filter(p: (A) => Boolean): Optional[A]
- final def filterNot(p: (A) => Boolean): Optional[A]
- final def flatMap[B](f: (A) => Optional[B]): Optional[B]
- final def flatten[B](implicit ev: <:<[A, Option[B]]): Option[B]
- final def fold[B](ifEmpty: => B)(f: (A) => B): B
- final def forall(p: (A) => Boolean): Boolean
- final def foreach[U](f: (A) => U): Unit
- final def getOrElse[A0 >: A](default: => A0): A0
- final def iterator: Iterator[A]
- final def map[B](f: (A) => B): Optional[B]
- final def orElse[B >: A](other: Optional[B]): Optional[B]
- final def toChunk: Chunk[A]
- final def toLeft[R](right: R): Either[A, R]
- final def toList: List[A]
- final def toOption: Option[A]
Converts this optional value to standard scala.Option
- final def toRight[L](left: L): Either[L, A]
- final def toVector: Vector[A]
- final def withFilter(p: (A) => Boolean): WithFilter