OptionalValue

io.scalaland.chimney.integrations.OptionalValue
trait OptionalValue[Optional, Value]

Tells Chimney how to interact with Optional type to align its behavior with Option of Value.

Type parameters

Optional

type storing optional Value - has to be proper type, not higher-kinded type

Value

type of internal value (if present)

Attributes

See also
Since

1.0.0

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def empty: Optional

Creates an empty optional value.

Creates an empty optional value.

Attributes

def fold[A](oa: Optional, onNone: => A, onSome: Value => A): A

Folds optional value just like Option.fold.

Folds optional value just like Option.fold.

Attributes

def of(value: Value): Optional

Creates non-empty optional value (should handle nulls as empty).

Creates non-empty optional value (should handle nulls as empty).

Attributes

Concrete methods

def getOrElse(oa: Optional, onNone: => Value): Value

Should work like Option.getOrElse.

Should work like Option.getOrElse.

Attributes

def orElse(oa: Optional, onNone: => Optional): Optional

Should work like Option.orElse.

Should work like Option.orElse.

Attributes