Say I have a following class:
case class Mock(id: Int, pty1: String, pty2: String)
How can I instantiate it from a following map dynamically?
val params = Map("id" → 234, "pty1" → "asdf", "pty2" → "asdf")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
LOL ) Found out that I had a solution already implemented in my lib. Requires Scala 2.10.