Created
August 24, 2012 21:11
-
-
Save LeifWarner/3455659 to your computer and use it in GitHub Desktop.
Lift-json decomposition / extraction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.json.{Extraction, DefaultFormats} | |
object Main { | |
implicit val formats = DefaultFormats | |
val p = Person("Leif", 33) | |
def main(args:Array[String]) { | |
val dp = Extraction decompose p | |
println(dp) | |
val rp = dp.extract[Person] | |
println(rp) | |
} | |
} | |
case class Person(name: String, age: Int) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment