Reputation: 1122
I have a method that accepts repeated tuples
myfn(attributes: (String, Any)*)
can I convert a map to a repeated tuple ?
for example val m = Map ("a1"->1,"a2"->8) // convert to tuple myfn(m1)
val m = Map ("a1"->1,"a2"->8) // convert to tuple myfn(m1)
Upvotes: 1
Views: 833
Reputation: 35980
Sure, why not?
def function(myMap.toList(): _*)
Upvotes: 4