Accept Builder to avoid build() call
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 85
- Forks
- 26
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 22
Description
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Could add overloads to methods accepting Foo to also accept
FooBuilder, avoiding the build() method call at the end.
Before:
ServiceArgs.builder()
.setMetadata(ObjectMetaArgs.builder()
.clusterName("clusterName")
.build())
After:
ServiceArgs.builder()
.setMetadata(ObjectMetaArgs.builder()
.clusterName("clusterName"))
Lifting @pawelprazak's idea to an issue. We can do this, it's syntactic sugar that costs some size in the generated SDKs but may be worth it.
Affected area/feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Java SDK generation code that produces methods accepting Foo and the corresponding FooBuilder, then trace how builder() and build() are represented in generated APIs. Done means callers can use the nested builder directly in examples like setMetadata without an explicit build() call, with generated SDK size considered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100