1

我有这两个案例类:主题和报告(定义如下):
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]很好。Lift/scala 序列化地图有问题吗?

4

0 回答 0