google/gson ? reverse-engineered prompt

Reverse engineered prompt

Build me a Java library that lets me turn normal Java objects into JSON and turn JSON back into Java objects again.

It should work with existing classes even if I can’t change them, and it should handle nested objects, inherited types, and generic types without making me write a bunch of annotations. I also want a way to customize how certain objects are written and read, so I can plug in special handling when needed.

Please make it easy to use with simple toJson and fromJson style methods, include a few clear examples, and add solid tests so I can trust it with real world objects. If there are edge cases around older Java versions or module support, keep it compatible and call those out in the docs. If you need to check current best practices or docs online while building it, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab