How can I dynamically search for an object property value by name in Scala 2.10.x?
eg. Given the class (this cannot be the case class):
class Row(val click: Boolean, val date: String, val time: String)
I want to do something like:
val fields = List("click", "date", "time") val row = new Row(click=true, date="2015-01-01", time="12:00:00") fields.foreach(f => println(row.getProperty(f)))
scala
jbrown
source share