Skip to content

Commit 6a6184a

Browse files
committed
Documenting why filter is not implemented
1 parent 538d84c commit 6a6184a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/scala/spray/json/Tription.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package spray.json
2020
*
2121
* Created by bathalh on 2/19/16.
2222
*/
23-
abstract class Tription[+T]
23+
sealed abstract class Tription[+T] extends Product
2424
{
2525
def isDefined: Boolean
2626
def isNull: Boolean
@@ -42,6 +42,10 @@ abstract class Tription[+T]
4242

4343
final def foreach[U](f: T => U): Unit =
4444
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)
4549
}
4650

4751
case class Value[+T](x: T) extends Tription[T] {

0 commit comments

Comments
 (0)