Optional

sealed trait Optional[+A]

Custom option type used in the generated Kubernetes data models.

Custom option type used in the generated Kubernetes data models.

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`` toOptional[A], and fromOption[A]`` to Optional[A].

This allows boilerplate-free definition of Kubernetes resources where most of the fields are optional.

Companion
object
class Object
trait Matchable
class Any
class Present[A]
object Absent

Type members

Classlikes

class WithFilter(p: A => Boolean)

Value members

Concrete methods

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

Converts this optional value to standard scala.Option

final def toRight[L](left: L): Either[L, A]
final def withFilter(p: A => Boolean): WithFilter

Abstract fields

val isDefined: Boolean
val isEmpty: Boolean
val nonEmpty: Boolean