Optional

org.finos.morphir.datamodel.Concept.Optional
case class Optional(elementType: Concept) extends Concept

We can only know if an optional-value is Some or None on the value-level, not the type-level because the parent-derivation stage does not know this information. This is generally understood to be a standard practice. For example, using Scala 3 enums, the specific type of an enum element is not known, only the general coproduct type. For example:

enum Customer:
 case Person
 case Robot

// this will be implicitly typed as Customer
val c = Customer.Person

Coproduct types in other languages (e.g. Haskell) work similarly.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def collect[T](p: PartialFunction[Concept, T]): Chunk[T]

Attributes

Inherited from:
Concept
def collectAll: Chunk[Concept]

Attributes

Inherited from:
Concept
def getName: Option[FQName]

Attributes

Inherited from:
Concept
def getNameString: Option[String]

Attributes

Inherited from:
Concept
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def toMorphirElm: String

Attributes

Inherited from:
Concept
def toStringPretty(color: Boolean, detailLevel: DetailLevel): String

Attributes

Inherited from:
Concept
def toStringPretty: String

Attributes

Inherited from:
Concept
def writeMorphirElmFiles(path: Path): ZIO[Any, Throwable, Unit]

Attributes

Inherited from:
Concept