Could you show an example of it? In none of the materials published so far there is anything even remotely similar to what you are suggesting.
http://cr.openjdk.java.net/~briangoetz/amber/datum.html
There you can read about algebraic data types in java, in Java 14 you get preview for records in Java 15 probably you'll get preview for sealed types - they were developed together for some time, only recently there was a split.
Record have an automatic way to propagate annotations from the record component to the generated methods/fields and comes with native support of serialization (like enums).