Scala: convert map to case class

前端 未结 6 2058
说谎
说谎 2020-12-01 01:53

Let\'s say I have this example case class

case class Test(key1: Int, key2: String, key3: String)

And I have a map

myMap = M         


        
6条回答
  •  春和景丽
    2020-12-01 02:25

    commons.mapper.Mappers.mapToBean[CaseClassBean](map)
    

    Details: https://github.com/hank-whu/common4s

提交回复
热议问题