Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala mutable map add

Tags:

scala

I'm using a mutable HashMap with the MultiMap mixin and noticed that the map.add method is now deprecated:

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

I'm basically mapping a string or token to a list of ids. Is there a different way I'm supposed to use the Map and MultiMap in Scala?

Thanks.

like image 752
Max Avatar asked Feb 25 '23 21:02

Max


1 Answers

As the deprecation message says, use addBinding instead.

like image 167
Rex Kerr Avatar answered Mar 08 '23 04:03

Rex Kerr