I'm working on a project where traditional Java serialization is slow, so we want to move on to implementing the Externalize interface for classes to provide superior performance.
However, these classes have many data members, and we realized that it is easy to make mistakes when writing these two methods. We just read / write all members of the class into these functions, nothing unusual. Is there a way to generate readExternal() writeExternal() blocks for emergency automation offline or at compile time?
I looked at http://projectlombok.org/ and something like that would be perfect.
Similarly, we would like to keep these classes immutable, but immutable classes cannot implement an interface that can be replaced - we want to use the proxy class template from efficient java, since the generated one will be useful.
java serialization lombok code-generation
MrLebowski
source share