Skip to content

handling of sealed abstract class #42

@pjfanning

Description

@pjfanning

In the code sample, below it would be great if this lib could produce an RType for the Animal class that exposes the 'children' sub types in a similar way to how SealedTraitInfo works.

sealed abstract class Animal {
  val name: String
  val animalType: String = "Animal"
}

class Dog(val name: String) extends Animal {
  override val animalType: String = "Dog"
}

class Cat(val name: String) extends Animal {
  override val animalType: String = "Cat"
}

Currently RType.of(classOf[Animal]) returns:

ScalaClassInfo(com.github.pjfanning.jackson.reflection.annotated.Animal):
   fields:
   non-constructor fields:
   annotations:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions