We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
At 62011fe#diff-9894c8ca988dd9ba18c16d1cc0176ca25e915f1b212f12e9c5f285d44fa10e72R81, the value of the example optional Property "b" was made using .b(Optional.of("bbbb"). I wonder, why one could not simply write .b("bbbb")? The method b can create the Optional by itself. - IMHO the code would be more readable.
.b(Optional.of("bbbb")
.b("bbbb")
b
Optional
The text was updated successfully, but these errors were encountered:
You can get that behavior by using addConcreteSettersForOptional = true. E.g.,
addConcreteSettersForOptional = true
@RecordBuilder @RecordBuilder.Options(builderMode = RecordBuilder.BuilderMode.STAGED_REQUIRED_ONLY, interpretNotNulls = true, useImmutableCollections = true, addConcreteSettersForOptional = true) public record OptionalListStaged(int a, Optional<String> b, double c, List<Instant> d, @Null String e, String f) { }
Sorry, something went wrong.
Thank you for the quick reply! 🤩 (I was about to comment after reading through https://github.com/Randgalt/record-builder/blob/master/options.md)
No branches or pull requests
At 62011fe#diff-9894c8ca988dd9ba18c16d1cc0176ca25e915f1b212f12e9c5f285d44fa10e72R81, the value of the example optional Property "b" was made using
.b(Optional.of("bbbb")
. I wonder, why one could not simply write.b("bbbb")
? The methodb
can create theOptional
by itself. - IMHO the code would be more readable.The text was updated successfully, but these errors were encountered: