How do I convert java.util.Map[String, Object] to scala.collection.immutable.Map[String, Any], so that all values in the original map (integers, booleans etc.) are converted to the right value to work well in Scala.
How do I convert java.util.Map[String, Object] to scala.collection.immutable.Map[String, Any], so that all values in
Share
As VonC says,
scala.collections.JavaConversionsupports mutable collections only, but you don’t have to use a separate library. Mutable collections are derived fromTraversableOncewhich defines atoMapmethod that returns an immutable Map:This will output