oxygen.core.Specified
See theSpecified companion object
Representation of an Option with a specialized purpose of whether a value is specified or not.
This has 2 main benefits:
- 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 - You have the ability to represent both
Specified[Int]andSpecified[Option[Int]]. This is very useful when it comes to things like partial updates. With only the ability to representOption[Int], you are often left stuck with being able to update toSome(_), and None meansno update. - 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 Objecttrait Matchableclass Any
- Known subtypes
-
object WasNotSpecifiedclass WasSpecified[A]
Members list
In this article