Scala modified map add

I am using a mutable HashMap with MultiMap mixing and noticed that the map.add method map.add now deprecated:

 val fieldTokenMap = new HashMap[String, scala.collection.mutable.Set[Int]] with MultiMap[String, Int] // ... fieldTokenMap add (token, docId) 

I basically bind a string or token to a list of identifiers. Is there any other way that I should use Map and MultiMap in Scala?

Thanks.

+4
source share
1 answer

As stated in the failure message, use addBinding .

+8
source

Source: https://habr.com/ru/post/1342532/


All Articles