There was an error while loading. Please reload this page.
1 parent 538d84c commit 6a6184aCopy full SHA for 6a6184a
1 file changed
src/main/scala/spray/json/Tription.scala
@@ -20,7 +20,7 @@ package spray.json
20
*
21
* Created by bathalh on 2/19/16.
22
*/
23
-abstract class Tription[+T]
+sealed abstract class Tription[+T] extends Product
24
{
25
def isDefined: Boolean
26
def isNull: Boolean
@@ -42,6 +42,10 @@ abstract class Tription[+T]
42
43
final def foreach[U](f: T => U): Unit =
44
if( hasValue ) f( this.get )
45
+
46
+ // not sure whether to return Null or Undefined if the filter criteria are not met
47
+// final def filter(p: T => Boolean): Tription[T] =
48
+// if (!hasValue || p(this.get)) this else (Undefined/Null)
49
}
50
51
case class Value[+T](x: T) extends Tription[T] {
0 commit comments