Skip to content

Instantly share code, notes, and snippets.

@bryce-anderson
Last active August 29, 2015 14:25
Show Gist options
  • Save bryce-anderson/77728fc66d757169f4b9 to your computer and use it in GitHub Desktop.
Save bryce-anderson/77728fc66d757169f4b9 to your computer and use it in GitHub Desktop.
sealed abstract class JValue
final class JBoolean private(val value: Boolean) extends JValue
object JBoolean {
val True = new JBoolean(true)
val False = new JBoolean(false)
def apply(value: Boolean): JBoolean = if (value) True else False
def unapply(bool: JValue): Option[Boolean] = ???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment