I have a nested data structure in case classes, like
case class A(b:B,c:C,d:D)
case class B(id:String, name:String)
case class C(cNode:String, cuser:String)
case class D(dData:String, dField:String)
I'm looking for a regex to track all fields from the Class A, through all of it's subclasses.
The code from this answer solve the first step of my problem. It list all of the fields of the first level (class A). I tried to change it to recursive call the same method but I can't get the TypeTag information of a MethodSymbol.
The result I'm expecting for this is a method that receives A as argument, and returns
(b.id, b.name,c.cNode, c.cUser,d.dData, d.dFile)
How can I get the subfields attribute names from a case class?
Aucun commentaire:
Enregistrer un commentaire