I'm working on getting the @Builder to work with an immutable class and be able to let the class be deserialized using the Jackson JsonDeserialize. The problem I'm running into is that the @Builder uses fluent setters, not "with-methods". Because of this the JsonDeserialize is not picking up on the fields/methods.
A comment was made in the proposed changes to the @Builder that would remove the fluent setting because no one is using the functionality. While I can't utilize the current non-fluent functionality ("set.."), if it did the "with-methods" that would help greatly.
Alternatively, if I could add an annotation to the Builder class, I could also solve this. By adding @JsonPOJOBuilder(withPrefix = "") to the builder I should be able to use the fluent methods for the builder and have the serialization work.
Thanks,
Bert
Sample:
@Data
@Builder(
@JsonDeserialize(builder = Book.BookBuilder.class)
// Something like this where I could add annotation to the builder
// @Builder(onBuilder == @__(@JsonPOJOBuilder(withPrefix = "")))
public final class Book
{
public final int id;
public final int name;
}