What is the preferred way to create class that is
By referencing answer by Joseph K. Strauss I came up with following solution.
Plain lombok annotations that worked out for me looks like this. Following annotations give you immutable classes with builder that can be serialized and deserialized by Jackson.
@Data
@Setter(AccessLevel.NONE)
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Clazz {
private String field;
}
I prefer this solution because it requires no additional Jackson specific annotations and no additional lombok specific files