-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For
@AutoBuilder
classes, generate a "copy constructor" if appropri…
…ate. For example, given this: ``` record Foo(String bar) { @autobuilder abstract class Builder { Builder setBar(String bar); Foo build(); } } ``` The built type is `Foo` (it is the return type of the `build()` method), and the record does have an implicit method `Foo.bar()`, so this qualifies. In addition to the `AutoBuilder_Foo_Builder()` constructor, we will declare `AutoBuilder_Foo_Builder(Foo source)`, which copies initial values for the builder from the given `source`. RELNOTES=The generated AutoBuilder class now has a "copy constructor" if values for the builder properties can be obtained from the built type. PiperOrigin-RevId: 448049949
- Loading branch information
1 parent
26f073f
commit b3b53a3
Showing
9 changed files
with
148 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b3b53a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eamonnmcmanus, what's the ETA for a release with these changes?
b3b53a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder! I see it's been 10 months since AutoValue 1.9, so a release was overdue, especially for this and other improvements to AutoBuilder. I've released 1.10 now.
b3b53a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was super quick. Thanks, @eamonnmcmanus!