Hi, Java code produced for getters & setters by the compiler always maps Avro primitive types to Java boxed types. The only exception is the setter of the builder.
Using unboxed types when possible would both avoid boxing costs, if not eliminated by the VM, and make the API less error prone. The type system would clearly distinguish the nullable case from the non-null one. Why is javaType() used in record.vm rather than javaUnbox() ? Would it be possible to push a such change into Avro ? Lastly, has anyone investigated the nullable issue for non boxed types ? Would it makes sense to define new options to support @Nullable / @NotNull annotations or Optional ? Clément
