Sunday, September 18, 2011

Scala map implicit conversion into Java Properties

As it looks that there's no implicit conversion of a Scala Map (of Strings) into a Java Properties even in the latest Scala release, let's define one.
  implicit def map2Properties(map:Map[String,String]):java.util.Properties = {
    val props = new java.util.Properties()
    map foreach { case (key,value) => props.put(key, value)}
    props
  }


Or even in a one line fashion, using folding :
  implicit def map2Properties(map:Map[String,String]):java.util.Properties = {
    (new java.util.Properties /: map) {case (props, (k,v)) => props.put(k,v); props}
  }


CONTEXT : Linux Gentoo / Scala 2.9.1 / Java 1.6.0_26

91 comments:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete
  2. Really very informative post you shared here. Keep sharing this type of informative blog. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.

    ReplyDelete
  3. Good and nice information... thanks for sharing your views and ideas. keep rocks and updating..Selenium Training Institute in Chennai | Selenium Training Institute in Velachery


    ReplyDelete
  4. Excellent Blog with informative content. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog. Best Web Design Training in Chennai | Angular JS Training in Chennai | Best CMS Training in Chennai

    ReplyDelete
  5. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    Java Training in Bangalore

    ReplyDelete
  6. Thanks for your marvelous posting! It is very useful and good. Come on. I want to introduce the best aso services for you, I try it and I feel it is so good to rank app to top in app store search results, have you ever heard it?

    ReplyDelete
  7. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    java training in bangalore
    java training in bangalore


    ReplyDelete
  8. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete
  9. And after 20 years, I'm doing it again - helping Australians who lost a lot of money, to get out of the United States and will still be able to keep the remaining capital that they have invested. scott

    ReplyDelete
  10. Ciitnoida provides Core and java training institute in

    noida
    . We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-

    oriented, java training in noida , class-based build

    of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an

    all-time high not just in India but foreign countries too.

    By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13

    years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best

    Java training in Noida.

    java training institute in noida
    java training in noida

    ReplyDelete
  11. Best Summer Internship In Noida

    These technologies prepare individuals for fields like software programming, technical support, graphic design, software testing, business analytics. Embedded Systems, Industrial Automation Training and more. Candidates go through a series of comprehensive practical sessions where they work on live problems and implement solutions on real-time basis.
    It has a dedicated placement cell which provides 100% placement assistance to students. The benefits that a student gets out of summer training are innumerable. CIITN,Best Summer training Center for B.Tech/CS/CSE/IT/ BCA/MCA/ B.E /M.tech / B.sc/ M.sc/ Engineering Student has already accomplished itself successfully in the field of Training and Development after setting milestones and bringing smiles to the faces of more than 1 Lakh students. CIITN was incorporated in the year 2002 and over the years CIITN has grown remarkably into the greatest training giant of Northern India.
    There is no looking back to technology! Those passionate for it need not worry about the professional prospects it offers. Courses and trainings in the field of Computer Science and Applications open a wide array of choices for individuals. All you need to do it prepare yourself right!

    Summer Internship Course In Noida

    Summer Internship Training In Noida

    ReplyDelete
  12. Awesome article.The information I have been searching precisely. It helped me a lot, thanks. Keep coming with more such informative article. Would love to follow them.
    sap abap programming training

    ReplyDelete

  13. Thanks for sharing this informative article..!!
    Keep posting waiting for next post
    iOS Training in Bangalore
    Java Training in Bangalore

    ReplyDelete
  14. It is really great work and the way in which you are sharing the knowledge is excellent. Thanks for your informative article
    RPA Training Course in Chennai | RPA Training Course in Velachery

    ReplyDelete
  15. Great post! Thanks for sharing with us, Its really gives lot of useful information. Regards,

    Angularjs Training in Chennai

    ReplyDelete
  16. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    No.1 Microsoft Azure Training Institute in Chennai | No.1 Microsoft Azure Training Institute in Velachery

    ReplyDelete
  17. The provided information’s are very useful to me. It’s a wonderful site for learning.Thank you for sharing this wonderful blog.
    Robotics Project Center Training in Chennai | Best Robotics Project Course in Tambaram

    ReplyDelete
  18. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
    Certified Ethical Hacking Training in Chennai | Certified Ethical Hacking Training in Velachery

    ReplyDelete
  19. Nice post. This post is very helpful. Thank you so much for sharing this post.
    CLOUD COMPUTING Classes in Chennai | CLOUD COMPUTING Courses in Velachery

    ReplyDelete
  20. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Selenium Testing Course in Chennai | Selenium Testing Course in Velachery

    ReplyDelete
  21. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
    No.1 Blue Prism Training Institute in Chennai | No.1 Blue Prism Training Institute in Velachery | No.1 Blue Prism Training Institute in Kanchipuram

    ReplyDelete
  22. Nice. You have clearly explained about it ...It’s very useful for me to know about new things. Keep on blogging..
    Automation Anywhere Training with Placement in Chennai | Automation Anywhere Training with Placement in Tambaram

    ReplyDelete
  23. I ‘d mention that most of us visitors are endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.
    JAVA and J2EE Training Institute in Chennai | JAVA and J2EE Training Institute in Velachery

    ReplyDelete
  24. I’d love to be a part of group where I can get advice from other experienced people that share the same interest. If you have any recommendations, please let me know. Thank you.
    No.1 Automation Anywhere Training Institute in Chennai | No.1 Automation Anywhere Training Institute in Velachery

    ReplyDelete
  25. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    UIPath Robotic Process Automation in Chennai | UIPath Training in Tambaram

    ReplyDelete
  26. Really it was an awesome article...very interesting to read.. You have provided a nice article....Thanks for sharing..
    No.1 Blue Prism Training Institute in Chennai | No.1 Blue Prism Training Institute in Kanchipuram

    ReplyDelete
  27. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
    Python Certification Course in Chennai | Python Certification Course in OMR

    ReplyDelete
  28. Post is very informative… It helped me with great information so I really believe you will do much better in the future.
    Best Cloud Computing Training Institute in Chennai |Best Cloud Computing Training Institute in Taramani

    ReplyDelete
  29. Nice Blog… Wonderful Information and really very much useful. Thanks for sharing and keep updating…
    Python Training Institute in Chennai | Python Training Institute in Velachery

    ReplyDelete
  30. Very informative blog. Thanks for sharing such good information and keep on updating.
    Hardware and Networking Training in Chennai | Hardware and Networking Training in Taramani

    ReplyDelete
  31. Impressive blog with lovely information. Really very useful article for us thanks for sharing such a wonderful blog...
    Best Hardware and Networking Training Institute in Chennai |Best Hardware and Networking Training Institute in Kanchipuram

    ReplyDelete
  32. It's very great post...Thanks for sharing such an informative post..
    C and C++ Training in Chennai | C and C++ Training in Taramani

    ReplyDelete
  33. Nice and informative article. Thanks for sharing such nice article, keep on updating.
    MCSE&MCSA Training institute in Chennai |MCSE&MCSA Training institute in Madipakkam

    ReplyDelete
  34. These provided information was really so nice, thanks for giving that post and the more skills to develop after refer that post.
    MCSE&MCSA Training institute in Chennai |MCSE&MCSA Training institute in Madipakkam

    ReplyDelete
  35. Really it was an awesome blog...... Very interesting to read, .It’s very helpful for me, Big thanks for the useful info and keep updating…
    CCNP Training Institute in Chennai | CCNP Training Institute in Velachery

    ReplyDelete
  36. This is really too useful and have more ideas from yours. keep sharing many techniques and thanks for sharing the information.
    Oracle Training in Chennai | Oracle Training in Kanchipuram

    ReplyDelete
  37. Your Blog is really amazing with useful information you are shared here...Thank you for sharing such an informative and awesome post with us. Keep blogging article like this……..
    AWS Training Institute in Chennai | AWS Training Institute in Velachery

    ReplyDelete
  38. This is a nice post in an interesting line of content.Thanks for sharing this article.
    Blueprism Exam Center in Chennai | Blueprism Exam Center in Velachery

    ReplyDelete
  39. Really I enjoy this blog….. Very nice post… Thanks for sharing and keep updating
    AWS Training Institute in Chennai | AWS Training Institute in Velachery

    ReplyDelete
  40. Awesome blog. Your articles really impressed for me, because of all information so nice and unique...
    Best UIPath Training Institute in Chennai | Best UIPath Training Institute in Velachery

    ReplyDelete
  41. Thank you so much for sharing such an amazing post with useful information with us. Keep updating such a wonderful blog….
    Best CCNA Training Institute in Chennai| CCNA Training Center in Velachery

    ReplyDelete
  42. Thank you so much for sharing such an amazing post with useful information with us. Keep updating such a wonderful blog….
    Best CCNA Training Institute in Chennai| CCNA Training Center in Velachery

    ReplyDelete
  43. Thank you for taking the time to provide us with your valuable information. Keep sharing your post regularly..
    Ethical Hacking Training Course in Chennai | Ethical Hacking Training Course in Nanganallur

    ReplyDelete
  44. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it…
    Best Selenium Training Institute in Chennai|Best Selenium Training Institute in Saidapet

    ReplyDelete
  45. The information you have here is really useful to make my knowledge good. It is truly supportive for us and I have accumulated some essential data from this blog.
    Best Selenium Training Institute in Chennai|Best Selenium Training Institute in Saidapet

    ReplyDelete
  46. This enables you to recycle your pot of cash to purchase another property. However, in this market, the Council of Mortgage Lenders have imposed a 6 month rule that prevents you remortgaging unless the property has been held for at least 6 months. Midtown dubai

    ReplyDelete
  47. Nice blog…. with lovely information. Really very useful article for us thanks for sharing such a wonderful blog. Keep updating…..
    Best Linux Training Institute in Pallikaranai| Best Linux Training Institute in Velachery

    ReplyDelete
  48. Awesome article…. Really very helpful information for us. Keep it up. Keep blogging. Looking to reading your next post,. Thank You for Sharing This Information
    Best PCB Training Institute in Taramani| Best PCB Training Institute in Velachery

    ReplyDelete
  49. Nice blog. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    RPA Training in Chennai | RPA Training in Pallikaranai

    ReplyDelete
  50. Good Post…. Thanks for the useful information it’s very useful to read your blog. Keep blogging article like this.
    Best JAVA/J2EE Training Institute in Perungudi| Best JAVA/J2EE Training Institute in Velachery

    ReplyDelete
  51. Nice blog, really I feel happy to see this useful blog… Thanks for sharing this valuable information to our vision....
    Best AWS Training Institute in Medavakkam| Best AWS Training Institute in Velachery

    ReplyDelete
  52. Nice blog…. with lovely information. Really very useful article for us thanks for sharing such a wonderful blog. Keep updating…..
    Blue prism Training in Chennai | Blue prism Training in Besant Nagar

    ReplyDelete
  53. Nice blog. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Best Selenium Training Institute in Chennai|Best Selenium Training Institute in Pallikaranai

    ReplyDelete
  54. Very useful post. I am getting lots of information from your site. Keep sharing. Thank you...
    Best Selenium Training Institute in Chennai|Best Selenium Training Institute in Pallikaranai

    ReplyDelete
  55. Really wonderful post.... My sincere thanks for sharing very useful information to the users... Please continue to share this kind of post
    Best Python Exams Center in OMR| Best Python Certification Exams in OMR

    ReplyDelete
  56. Thanks for sharing this valuable information.. I saw your website and get more details..Nice work...
    Automation Anywhere Training in Chennai | Automation Anywhere Training in Ashok Nagar

    ReplyDelete
  57. Nice blog. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Perfect and Outstanding Dotnet Training Institute in Chennai| Perfect and Outstanding Dotnet Training Institute in Adyar

    ReplyDelete
  58. Impressive blog with lovely information. Really very useful article for us thanks for sharing such a wonderful blog...
    Perfect and Outstanding Dotnet Training Institute in Chennai| Perfect and Outstanding Dotnet Training Institute in Adyar

    ReplyDelete
  59. I have read your blog. It’s very informative and useful blog. You have done really great job. Keep update your blog.
    Graphic Designing Training in Chennai | Graphic Designing Training in Keelkattalai

    ReplyDelete
  60. Wonderful blog… You provided very interesting information here. I feel happy to read this post. I hope that you will write many posts like this… Thanks for sharing and Keep updating…..
    Python Training Institute in Chennai | Python Training Institute in Velachery

    ReplyDelete
  61. Impressive blog with lovely information. Really very useful article for us thanks for sharing such a wonderful blog...
    Best Selenium Training Institute in Chennai |Best Selenium Training Institute in Chennai

    ReplyDelete
  62. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...
    Best Selenium Training Institute in Chennai |Best Selenium Training Institute in Chennai

    ReplyDelete
  63. Good Post…. Thanks for the useful information it’s very useful to read your blog. Keep blogging article like this.
    UIPath Training in Chennai | UIPath Training in Kanchipuram

    ReplyDelete
  64. I have read your blog. It’s very informative and useful blog. You have done really great job. Keep update your blog.
    Ethical Hacking Training in Chennai | Ethical Hacking Training in Thiruvanmiyur

    ReplyDelete
  65. This is really too useful and have more ideas from yours. keep sharing many techniques. eagerly waiting for your new blog and useful information. keep doing more.
    Java Training in Chennai | Java Training in St.Thomas Mount

    ReplyDelete