Closed abdelhak-zaaim closed 2 months ago
That has been suggested and denied several times. This feature is out of scope for Lombok, and there are several frameworks that can do it much better than Lombok could ever do.
See the other issues for more details.
I would like to propose an enhancement to Lombok by introducing two new annotations: @ToJson and @FromJson. These annotations would automatically generate methods for JSON serialization and deserialization in a class, streamlining the process of converting objects to and from JSON. This feature would reduce the need for external libraries or manual implementations in Java classes.
@ToJson @FromJson public class MyClass { private String field1; private int field2; }
Expected Behavior:
Proposed Method Signatures:
String toJson();
static MyClass fromJson(String json);
Benefits: