Suppose I have the following case class:
object Example extends App {
case class Cat(name: String, age: Int)
val bob = Cat("Bob", 42)
println(Cat.getClass.getFields)
println(bob.getClass.getFields)
}
Is there a nice way I can get the field names and the values?
Something like:
Map(name -> "Bob", age -> 42)