Support for partial Java types

Gunnar Morling gunnar at
Fri Apr 13 13:13:44 UTC 2018

Hi all,

Any thoughts on the idea of supporting partial classes in Java?

Or would another list be better suited for discussing this (if so, I'd be
happy about any hint to which list I should send it)?



2018-04-11 20:47 GMT+02:00 Gunnar Morling <gunnar at>:

> Hi,
> The ongoing records discussion made me remember a proposal I made a while
> ago but which went without much feedback back then -- adding support for
> partial types to the Java language:
> November/003607.html
> The idea would be to allow a Java class to be split up into multiple
> source files, where typically one of them would be hand-written by the
> developer and other partials would be created at compile time by code
> generators, based on meta-data given in the main partial.
> This would essentially allow to implement something like "records" using
> compile time tooling (annotation processors), which e.g. could add getters,
> equals()/hashCode()/toString(), constructors etc. in derived partials,
> based on (annotated) field definitions in the main partial.
> Such approach wouldn't yield one canonical records representation baked
> into the language, but would allow for more tailored definitions, each
> suitable for different use cases. Of course a de-facto standard may evolve
> over time. I can see how this could be considered as an advantage by some
> and as disadvantage by others.
> I felt it'd be a good time to raise the idea again to gauge what others
> here think.
> Thanks,
> --Gunnar

More information about the amber-dev mailing list