Specified

oxygen.core.Specified
See theSpecified companion object
sealed trait Specified[+A]

Representation of an Option with a specialized purpose of whether a value is specified or not.

This has 2 main benefits:

  1. You can define a function like def doStuff(a: Specified[Int] = Specified.WasNotSpecified): Unit = ??? and then call it like: doStuff(5) because of the given Conversion
  2. You have the ability to represent both Specified[Int] and Specified[Option[Int]]. This is very useful when it comes to things like partial updates. With only the ability to represent Option[Int], you are often left stuck with being able to update to Some(_), and None means no update.
  3. You can tell the difference between: {} // Specified.WasNotSpecified { "field": null } // Specified.WasSpecified(None) { "field": 5 } // Specified.WasSpecified(Some(5))

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class WasSpecified[A]

Members list

Value members

Concrete methods

final def filter(f: A => Boolean): Specified[A]
final def filterNot(f: A => Boolean): Specified[A]
final def flatMap[B](f: A => Specified[B]): Specified[B]
final def flatMapOption[B](f: A => Option[B]): Specified[B]
final def getOrElse[A2 >: A](default: => A2): A2
final def isNotSpecified: Boolean
final def isSpecified: Boolean
final def map[B](f: A => B): Specified[B]
final def orElse[A2 >: A](alternative: => Specified[A2]): Specified[A2]
final def toOption: Option[A]
final override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any