I have a Scala collection history
as follows:
import scala.collection.mutable.{Map => mm, Set => mSet}
private var history: mm[Int, mSet[String]] = mm[Int, mSet[String]]()
And getHistory()
Scala function returns history
to type mm[Int, mSet[String]]
. This is the Java code that stores the return value of history
.
import scala.collection.mutable.Map;
import scala.collection.mutable.Set;
??? history = Database.getHistory();
The issue is that only Map<Object, Set<String>>
causes no error. I tried with Map<Integer, ...>
and Map<scala.Int, ...>
, but nothing works.
Why is this error? I need to get the keys as a set (or iterator) of Integers so that I can iterate over/sort them.