CruncherBigData
CruncherBigData

Reputation: 1122

how to convert map into repeated tuple in scala

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)

Upvotes: 1

Views: 833

Answers (1)

wheaties
wheaties

Reputation: 35980

Sure, why not?

 def function(myMap.toList(): _*)

Upvotes: 4

Related Questions