playframework/Play20 — pull request #68 by mandubian (2012-01-04 22:52:15+00:00)
Title: JSON enhancements : Facilities to build Case Class Formatters (like SJSON asProductN)

Added to play.api.libs.json package, buildFormatN with N(1->22) functions to build Implicit Class Formatters for classes having 2 functions (case class) :
* apply(T1, T2, T3, ..., TN) => S
* extractor-like unapply S => Option[ProductN[T1, T2, T3, ..., TN]]

Inspired by SJSON asProductN functions and a bit simplified...

To be added after class definition for ex:
```scala
case class Foo(bar1:String, bar2:Int)
implicit val FooFormat = buildFormat2("bar1", "bar2")(Foo.apply)(Foo.unapply)
//or shorter
implicit val FooFormat = buildFormat2("bar1", "bar2")(Foo)(Foo.unapply)
```