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] Would you be able to add @Builder.Required to sure fields exist? #3640

Open
jacobhboy opened this issue Mar 26, 2024 · 0 comments
Open

Comments

@jacobhboy
Copy link

jacobhboy commented Mar 26, 2024

As I know, there is no way lombok sure the fields exist when using @Builder. I think Suring the value exist is essential when using build written by another developer.

when defining

@Builder
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class A {
    @Builder.Required
    private Long a;

    private Long b;

when using

A.builder(1L)
    .b(2L)
    .build();

Additional context
I think @Builder.Excepted which remove the field from builder is good too.

@jacobhboy jacobhboy changed the title [FEATURE] Would you be able to add @Builder.Required to sure fileds exist? [FEATURE] Would you be able to add @Builder.Required to sure fields exist? Mar 26, 2024
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

1 participant