I have this simple code:
@Data
@Builder
public class RegistrationInfo {
private String mail;
private String password;
public RegistrationInfo(R
You can either add an @AllArgsConstructor annotation, because
@Buildergenerates an all-args constructor iff there are no other constructors defined.
(Quotting @Andrew Tobilko)
Or set an attribute to @Builder : @Builder(toBuilder = true) This gives you the functionality of a copy constructor.
@Builder(toBuilder = true)
class Foo {
// fields, etc
}
Foo foo = getReferenceToFooInstance();
Foo copy = foo.toBuilder().build();