jeudi 18 avril 2019

Get all public fields with values in object of Scala class

How to get all public fields (including inherited) and their values from object of Scala class?

This:

  class A(val a: String)

  class B(val b: String) extends A("a")

  val b = new B("b")

  b.getClass.getFields

returns empty list.





Aucun commentaire:

Enregistrer un commentaire