Why is Lombok @Builder not compatible with this constructor?

You can either add an @AllArgsConstructor annotation, because

@Builder generates an all-args constructor iff there are no other
constructors defined.

(Quotting @Andrew Tobilko)

Or set an attribute to @Builder : @Builder(toBuilder = true) This give you the functionality of a copy constructor.

@Builder(toBuilder = true)
class Foo {
    // fields, etc
}

Foo foo = getReferenceToFooInstance();
Foo copy = foo.toBuilder().build();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)