I'm new to Scala. I've been trying to convert a java LinkedHashMap to an equivalent collection(LinkedHashMap?) in Scala in order to preserve the insertion order.
Tried following things as suggested in other threads, but nothing seems to work!
scalaAsMap()
- is messing up the order
TreeMap()
- sort on keys, values, etc. is not something I'm looking for
Explicit conversion is not working.
val f = new java.util.LinkedHashMap[String, java.util.Map[String, String]]
var g: scala.collection.mutable.LinkedHashMap[String, java.util.Map[String, String]] = f
Copyright Notice:Content Author:「miniscule001」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40007857/how-to-convert-java-linkedhashmap-to-scala-linkedhashmap