You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They have an abstract class or a trait as a base (usually sealed) and several sub-classes or implementations (usually case classes or objects):
sealed trait ADTBase extends Product with Serializable
case class X(a: Int) extends ADTBase
case class Y(b: String, c: Double) extends ADTBase
case object Z extends ADTBase
Most common representation for them is using of additional field with a discriminator value that usually contains a simple name of sub-class or implementation:
{"type":"Y","b":"VVV","c":777}
The text was updated successfully, but these errors were encountered:
In Java this is only supported through the annotation processor.
I'd rather improve the Scala side of things for code-gen than add more options to reflection based implementation ;(
They have an abstract class or a trait as a base (usually sealed) and several sub-classes or implementations (usually case classes or objects):
Most common representation for them is using of additional field with a discriminator value that usually contains a simple name of sub-class or implementation:
The text was updated successfully, but these errors were encountered: