映射到电梯中的json序列化

时间:2013-06-18 20:24:05

标签: scala serialization lift

我有两个案例类:主题和报告(下面的定义):
case class Topic(name:String, queryWords:Set[String])

case class Report(dateRange: org.joda.time.Interval, queryWord: String, topics: Map[Topic,Boolean], allOtherTopics: Map[Topic,Boolean])

我有一份我要序列化的报告列表:reports: List[Report]但它给了我一个scala.MatchError

..
val writer = new BufferedWriter(new FileWriter(file))
Serialization.write(reports, writer)      <--error right here
..

开始或堆栈跟踪:

scala.MatchError: (Topic(steam,Set(steam)),true) (of class scala.Tuple2)
        at net.liftweb.json.Extraction$$anonfun$decompose$1.apply(Extraction.sca
la:82) ~[lift-json_2.10-2.5-RC6.jar:2.5-RC6]
..

问:我的反序列化出了什么问题?
我序列化List[Topic]很好。电梯/ scala是否在序列化地图时出现问题?

0 个答案:

没有答案