Packages

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
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Optional
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class WithFilter extends AnyRef

Abstract Value Members

  1. abstract val isDefined: Boolean
  2. abstract val isEmpty: Boolean
  3. abstract val nonEmpty: Boolean

Concrete Value Members

  1. final def collect[B](pf: PartialFunction[A, B]): Optional[B]
  2. final def contains[A1 >: A](elem: A1): Boolean
  3. final def exists(p: (A) => Boolean): Boolean
  4. final def filter(p: (A) => Boolean): Optional[A]
  5. final def filterNot(p: (A) => Boolean): Optional[A]
  6. final def flatMap[B](f: (A) => Optional[B]): Optional[B]
  7. final def flatten[B](implicit ev: <:<[A, Option[B]]): Option[B]
  8. final def fold[B](ifEmpty: => B)(f: (A) => B): B
  9. final def forall(p: (A) => Boolean): Boolean
  10. final def foreach[U](f: (A) => U): Unit
  11. final def getOrElse[A0 >: A](default: => A0): A0
  12. final def iterator: Iterator[A]
  13. final def map[B](f: (A) => B): Optional[B]
  14. final def orElse[B >: A](other: Optional[B]): Optional[B]
  15. final def toChunk: Chunk[A]
  16. final def toLeft[R](right: R): Either[A, R]
  17. final def toList: List[A]
  18. final def toOption: Option[A]

    Converts this optional value to standard scala.Option

  19. final def toRight[L](left: L): Either[L, A]
  20. final def toVector: Vector[A]
  21. final def withFilter(p: (A) => Boolean): WithFilter