import com.google.gson.{JsonObject, JsonParser}
import scala.collection.JavaConversions._
val jsonStr = """{"a": 1, "b": 2, "c": 3}"""
val jsonParser = new JsonParser()
val jsonObj = jsonParser.parse(jsonStr).asInstanceOf[JsonObject]
val json2map = jsonObj.entrySet.map(x => (x.getKey, x.getValue)).toMap
文章来源:https://blog.csdn.net/qq_37267676/article/details/116668384