Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip generation of 'empty' copy method #89

Closed
mkarneim opened this issue Nov 26, 2014 · 0 comments
Closed

Skip generation of 'empty' copy method #89

mkarneim opened this issue Nov 26, 2014 · 0 comments
Labels
Milestone

Comments

@mkarneim
Copy link
Owner

As reported in #88 it is confusing if a generated builder provides a copy method that actually does not copy anything:

public ContactBuilder copy(Contact pojo) {
  return self;
}

This happens for example, if the given pojo provides no accessible getter methods (following the Java Beans standard) for its fields:

public class Contact {
  private final String name;
  private final String email;

  @GeneratePojoBuilder(withCopyMethod = true)
  public Contact(String name, String email) {
    this.name = name;
    this.email = email;
  }
}

In such cases PB should skip the generation of the copy method and emit a warning.

@mkarneim mkarneim added this to the 3.3.0 milestone Nov 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant