I have a Seq containing objects of a class that looks like this:
Seq
class A (val key: Int, ...)
Now I want to convert this Seq<
Seq<
Map over your Seq and produce a sequence of tuples. Then use those tuples to create a Map. Works in all versions of Scala.
Map
val map = Map(seq map { a => a.key -> a }: _*)