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

[FEATURE] record support for @Builder #2851

Closed
ktechies opened this issue May 21, 2021 · 3 comments
Closed

[FEATURE] record support for @Builder #2851

ktechies opened this issue May 21, 2021 · 3 comments

Comments

@ktechies
Copy link

Describe the feature
Currently the @builder annotation doesn't seem to support java 16 records yet. Records are in my view a good addition that removes a bunch of boilerplate code. however they are sadly limited and overloading a record constructor is a hassle when they get more members.

Describe the target audience
Java 16 developers.

Additional context
records implicitly have an "allargsconstructor" already.

when currently annotating a record with @builder is seems that none of the members are added to the builder class, even tho this might be a bug i consider this request a feature because records are a new feature to java.

public class Test {

@Builder
record Rtest(boolean one, String two, int three) {
    
}

@Test
public void builderTest() {
    Rtest.builder().<< no methods?
}

}

@janrieke
Copy link
Contributor

janrieke commented May 21, 2021

@Builder on records is supported since the last release v1.18.20. Which version are you using?
Note that this may also be just an IDE issue. If you are using IntelliJ, it may not be supported, yet.

@ktechies
Copy link
Author

just updated to 1.18.20, using IntelliJ indeed. compile seems to work fine now but IDE isn't aware yet.

thanks for the suggestion

@openminded-oscar
Copy link

Nice!

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

3 participants