scala的map的操作

1:map和模式匹配的结合

settings.foreach{case (k,v) => set(k,v)}

2:map转成array

 settings.entrySet().asScala.map( x => (x.getKey, x.getValue)).toArray

 

posted @ 2015-10-25 19:53  高兴的博客  阅读(1316)  评论(0编辑  收藏  举报