-
Notifications
You must be signed in to change notification settings - Fork 53
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
Issue #123: support nullable collections #156
Issue #123: support nullable collections #156
Conversation
…'interpretNotNulls' options
Thanks for this. I'll have a look very soon |
|
||
import static io.soabase.recordbuilder.processor.RecordBuilderProcessor.generatedRecordBuilderAnnotation; | ||
import static io.soabase.recordbuilder.processor.RecordBuilderProcessor.recordBuilderGeneratedAnnotation; | ||
|
||
class CollectionBuilderUtils { | ||
|
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.
nit: blank line
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.
fixed
Thanks for this PR - it looks very good. I tried a class that only has |
I see, didn't think of that combination before. Since NOP is the expected behavior in this case (components and builder getters just return whatever you set to them, without any shim calls etc.), I think we can emit a warning that it will have no effect. I'd rather not enable |
…non-specialized collections
A warning (or error) would be good. I'd prefer that to doing nothing. |
Agree. Added in the last commit :) |
Thank you for this |
Solves #123
There's a new
allowNullableCollections
option that does the following:false
(default value for BC), does nothingtrue
andinterpretNotNulls = false
, a list/set/map/collection record component will return null if value is not settrue
andinterpretNotNulls = true
, a list/set/map/collection record component will return null only if it's determined to be nullable, i.e. isn't annotated by any of the not-null patternsAll branches mentioned above should be covered by the
TestNullableCollectionsBuilder
test