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

add unbuild to @builder #140

Open
dabraham02124 opened this issue May 2, 2013 · 2 comments
Open

add unbuild to @builder #140

dabraham02124 opened this issue May 2, 2013 · 2 comments

Comments

@dabraham02124
Copy link

In addition to all the neat stuff in the @builder annotation, could you please add an unbuild method? This would create a builder based on the object in question.
Thus if object personName1 has firstName = "John" and lastName = "Smith" you could do this:

personName2 = personName1.unbuild().lastName("Johnson").build();

yielding personName2 with firstName = "John" and lastName = "Johnson"

Also you could implement clone() pretty directly from this if you wanted.

@benmccann
Copy link

+1 (though I'd prefer that the method be named builder())

@dabraham02124
Copy link
Author

That makes sense. I'd been reasoning by contrast with build(), but this method would be on the actual object, not the builder, so that makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants