Details
-
Wish
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.9.0
-
None
-
None
Description
Currently Java code generated by the avro-maven-pluginĀ implements the org.apache.avro.specific.SpecificRecord interface, but there is no ability to have the generated code implement additional interfaces, which would make it possible to improve type-safety and readability.
Similar to the already existing @java-class annotation (https://avro.apache.org/docs/current/idl.html#minutiae_annotations) I suggest adding a @java-implements annotation that could be added to a record definition:
@java-implements("an.example.JavaInterface") record AnExampleRecord { ...
This would be used by the avro-maven-plugin when generating Java code such that the result implements both SpecificRecord and the specified interface:
public class AnExampleRecord extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord , an.example.JavaInterface