serializer
serializer copied to clipboard
Question: are immutable objects with builders supported?
In our code, we have a lot of DTOs like this:
@lombok.Value
@lombok.Builder
class Entity {
String requiredField;
@lombok.Builder.Default
String requiredFieldWithDefaultValue = "default value";
}
For the provided example, Lombok generates a private constructor, getters, and a builder with a default value for requiredFieldWithDefaultValue
field.
Will such an object be correctly deserialized by this library? By "correctly" I mean:
- Deserialization works with a private constructor.
- If the
requiredFieldWithDefaultValue
field was added only in the second version of the class, deserializing content from the first version (without this field) will have"default value"
as a default value for the field.